diff options
| author | David Malcolm <dmalcolm@redhat.com> | 2024-07-04 14:44:51 -0400 |
|---|---|---|
| committer | David Malcolm <dmalcolm@redhat.com> | 2024-07-04 14:47:14 -0400 |
| commit | f8c130cdf531653e5c041d247729851419bc7bde (patch) | |
| tree | d995a1fa208da74f0d1664aa8bd0ccec908d8811 /gcc/analyzer/sm-pattern-test.cc | |
| parent | a6fdb1a2a2906103afd70fa68cf7c45e896b8fbb (diff) | |
| download | gcc-f8c130cdf531653e5c041d247729851419bc7bde.zip gcc-f8c130cdf531653e5c041d247729851419bc7bde.tar.gz gcc-f8c130cdf531653e5c041d247729851419bc7bde.tar.bz2 | |
analyzer: convert sm_context * to sm_context &
These are never nullptr and never change, so use a reference rather
than a pointer.
No functional change intended.
gcc/analyzer/ChangeLog:
* diagnostic-manager.cc
(diagnostic_manager::add_events_for_eedge): Pass sm_ctxt by
reference.
* engine.cc (impl_region_model_context::on_condition): Likewise.
(impl_region_model_context::on_bounded_ranges): Likewise.
(impl_region_model_context::on_phi): Likewise.
(exploded_node::on_stmt): Likewise.
* sm-fd.cc: Update all uses of sm_context * to sm_context &.
* sm-file.cc: Likewise.
* sm-malloc.cc: Likewise.
* sm-pattern-test.cc: Likewise.
* sm-sensitive.cc: Likewise.
* sm-signal.cc: Likewise.
* sm-taint.cc: Likewise.
* sm.h: Likewise.
* varargs.cc: Likewise.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/analyzer_gil_plugin.c: Update all uses of
sm_context * to sm_context &.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/analyzer/sm-pattern-test.cc')
| -rw-r--r-- | gcc/analyzer/sm-pattern-test.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/analyzer/sm-pattern-test.cc b/gcc/analyzer/sm-pattern-test.cc index 674d958..b56289a 100644 --- a/gcc/analyzer/sm-pattern-test.cc +++ b/gcc/analyzer/sm-pattern-test.cc @@ -58,11 +58,11 @@ public: bool inherited_state_p () const final override { return false; } - bool on_stmt (sm_context *sm_ctxt, + bool on_stmt (sm_context &sm_ctxt, const supernode *node, const gimple *stmt) const final override; - void on_condition (sm_context *sm_ctxt, + void on_condition (sm_context &sm_ctxt, const supernode *node, const gimple *stmt, const svalue *lhs, @@ -110,7 +110,7 @@ pattern_test_state_machine::pattern_test_state_machine (logger *logger) } bool -pattern_test_state_machine::on_stmt (sm_context *sm_ctxt ATTRIBUTE_UNUSED, +pattern_test_state_machine::on_stmt (sm_context &sm_ctxt ATTRIBUTE_UNUSED, const supernode *node ATTRIBUTE_UNUSED, const gimple *stmt ATTRIBUTE_UNUSED) const { @@ -124,7 +124,7 @@ pattern_test_state_machine::on_stmt (sm_context *sm_ctxt ATTRIBUTE_UNUSED, constant. */ void -pattern_test_state_machine::on_condition (sm_context *sm_ctxt, +pattern_test_state_machine::on_condition (sm_context &sm_ctxt, const supernode *node, const gimple *stmt, const svalue *lhs, @@ -138,10 +138,10 @@ pattern_test_state_machine::on_condition (sm_context *sm_ctxt, if (!rhs_cst) return; - if (tree lhs_expr = sm_ctxt->get_diagnostic_tree (lhs)) + if (tree lhs_expr = sm_ctxt.get_diagnostic_tree (lhs)) { - sm_ctxt->warn (node, stmt, lhs_expr, - make_unique<pattern_match> (lhs_expr, op, rhs_cst)); + sm_ctxt.warn (node, stmt, lhs_expr, + make_unique<pattern_match> (lhs_expr, op, rhs_cst)); } } |
