/* A state machine for use in DejaGnu tests, to check that
pattern-matching works as expected.
- Copyright (C) 2019-2022 Free Software Foundation, Inc.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
Contributed by David Malcolm <dmalcolm@redhat.com>.
This file is part of GCC.
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
+#include "make-unique.h"
#include "tree.h"
#include "function.h"
#include "basic-block.h"
#include "gimple.h"
#include "tree-pretty-print.h"
#include "diagnostic-path.h"
-#include "diagnostic-metadata.h"
-#include "function.h"
-#include "json.h"
#include "analyzer/analyzer.h"
#include "diagnostic-event-id.h"
#include "analyzer/analyzer-logging.h"
#include "analyzer/sm.h"
#include "analyzer/pending-diagnostic.h"
-#include "tristate.h"
-#include "selftest.h"
#include "analyzer/call-string.h"
#include "analyzer/program-point.h"
#include "analyzer/store.h"
return 0;
}
- bool emit (rich_location *rich_loc) final override
+ bool emit (diagnostic_emission_context &ctxt) final override
{
- return warning_at (rich_loc, get_controlling_option (),
- "pattern match on %<%E %s %E%>",
- m_lhs, op_symbol_code (m_op), m_rhs);
+ return ctxt.warn ("pattern match on %<%E %s %E%>",
+ m_lhs, op_symbol_code (m_op), m_rhs);
}
private:
if (tree lhs_expr = sm_ctxt->get_diagnostic_tree (lhs))
{
- pending_diagnostic *diag = new pattern_match (lhs_expr, op, rhs_cst);
- sm_ctxt->warn (node, stmt, lhs_expr, diag);
+ sm_ctxt->warn (node, stmt, lhs_expr,
+ make_unique<pattern_match> (lhs_expr, op, rhs_cst));
}
}