public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] analyzer: remove dead code
@ 2021-03-02 10:38 Martin Liška
  2021-03-02 13:38 ` David Malcolm
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Liška @ 2021-03-02 10:38 UTC (permalink / raw)
  To: gcc-patches

The issue is reported by Clang:

warning: private field 'm_engine' is not used [-Wunused-private-field]

gcc/analyzer/ChangeLog:

	* diagnostic-manager.cc (diagnostic_manager::emit_saved_diagnostics):
	Do not pass engine.
---
  gcc/analyzer/diagnostic-manager.cc | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc
index f0f447f14dc..7f20841768b 100644
--- a/gcc/analyzer/diagnostic-manager.cc
+++ b/gcc/analyzer/diagnostic-manager.cc
@@ -545,8 +545,6 @@ public:
  class dedupe_winners
  {
  public:
-  dedupe_winners (engine *eng) : m_engine (eng) {}
-
    ~dedupe_winners ()
    {
      /* Delete all keys, but not the saved_diagnostics.  */
@@ -642,8 +640,6 @@ public:
    }
  
  private:
-  engine *m_engine;
-
    /* This maps from each dedupe_key to a current best saved_diagnostic.  */
  
    typedef hash_map<const dedupe_key *, saved_diagnostic *,
@@ -679,7 +675,7 @@ diagnostic_manager::emit_saved_diagnostics (const exploded_graph &eg)
       instance.  This partitions the saved diagnostics by dedupe_key,
       generating exploded_paths for them, and retaining the best one in each
       partition.  */
-  dedupe_winners best_candidates (eg.get_engine ());
+  dedupe_winners best_candidates;
  
    int i;
    saved_diagnostic *sd;
-- 
2.30.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] analyzer: remove dead code
  2021-03-02 10:38 [PATCH] analyzer: remove dead code Martin Liška
@ 2021-03-02 13:38 ` David Malcolm
  2021-03-02 13:40   ` Martin Liška
  0 siblings, 1 reply; 7+ messages in thread
From: David Malcolm @ 2021-03-02 13:38 UTC (permalink / raw)
  To: Martin Liška, gcc-patches

On Tue, 2021-03-02 at 11:38 +0100, Martin Liška wrote:
> The issue is reported by Clang:
> 
> warning: private field 'm_engine' is not used [-Wunused-private-
> field]

Thanks; FWIW I think I removed the usage in
a505fad4dd4d93b6d642995d7df320aa40949568.

LGTM
Dave



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] analyzer: remove dead code
  2021-03-02 13:38 ` David Malcolm
@ 2021-03-02 13:40   ` Martin Liška
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Liška @ 2021-03-02 13:40 UTC (permalink / raw)
  To: David Malcolm, gcc-patches

On 3/2/21 2:38 PM, David Malcolm wrote:
> On Tue, 2021-03-02 at 11:38 +0100, Martin Liška wrote:
>> The issue is reported by Clang:
>>
>> warning: private field 'm_engine' is not used [-Wunused-private-
>> field]
> 
> Thanks; FWIW I think I removed the usage in
> a505fad4dd4d93b6d642995d7df320aa40949568.

Good! Apparently, the clang warning is quite useful.
I've just pushed the patch.

Thanks,
Martin

> 
> LGTM
> Dave
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] analyzer: remove dead code
  2020-11-10 16:57 ` David Malcolm
@ 2020-11-10 17:00   ` Jeff Law
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff Law @ 2020-11-10 17:00 UTC (permalink / raw)
  To: David Malcolm, Martin Liška, gcc-patches


On 11/10/20 9:57 AM, David Malcolm via Gcc-patches wrote:
> On Fri, 2020-10-23 at 17:26 +0200, Martin Liška wrote:
>> Hey.
>>
>> I've noticed that when building GCC with Clang.
>> David what do you think about it?
> Thanks for the patch.
>
> Looks good to me, assuming it goes through normal bootstrap and
> regression-testing.
>
> That said, technically I'm not a maintainer for the analyzer, unless
> you count it as part of "diagnostic messages"; I've been making very
> liberal use of Jeff's permission to commit followup work when he
> approved the initial patch kit last year (in the hope that the steering
> committee will make it official at some point).

I think you should be able to ack stuff in the analyzer, I'd actually
deleted this from my queue on the assumption you'd take care of it. :-)


But just to be safe, Martin, the patch is fine :-)


jeff


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] analyzer: remove dead code
  2020-10-23 15:26 Martin Liška
  2020-11-09 14:25 ` Martin Liška
@ 2020-11-10 16:57 ` David Malcolm
  2020-11-10 17:00   ` Jeff Law
  1 sibling, 1 reply; 7+ messages in thread
From: David Malcolm @ 2020-11-10 16:57 UTC (permalink / raw)
  To: Martin Liška, gcc-patches

On Fri, 2020-10-23 at 17:26 +0200, Martin Liška wrote:
> Hey.
> 
> I've noticed that when building GCC with Clang.
> David what do you think about it?

Thanks for the patch.

Looks good to me, assuming it goes through normal bootstrap and
regression-testing.

That said, technically I'm not a maintainer for the analyzer, unless
you count it as part of "diagnostic messages"; I've been making very
liberal use of Jeff's permission to commit followup work when he
approved the initial patch kit last year (in the hope that the steering
committee will make it official at some point).

Dave


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] analyzer: remove dead code
  2020-10-23 15:26 Martin Liška
@ 2020-11-09 14:25 ` Martin Liška
  2020-11-10 16:57 ` David Malcolm
  1 sibling, 0 replies; 7+ messages in thread
From: Martin Liška @ 2020-11-09 14:25 UTC (permalink / raw)
  To: gcc-patches

PING^1

On 10/23/20 5:26 PM, Martin Liška wrote:
> Hey.
> 
> I've noticed that when building GCC with Clang.
> David what do you think about it?
> 
> Thanks,
> Martin
> 
> gcc/analyzer/ChangeLog:
> 
>      * constraint-manager.cc (constraint_manager::merge): Remove
>      unused code.
>      * constraint-manager.h: Likewise.
>      * program-state.cc (sm_state_map::sm_state_map): Likewise.
>      (program_state::program_state): Likewise.
>      (test_sm_state_map): Likewise.
>      * program-state.h: Likewise.
>      * region-model-reachability.cc (reachable_regions::reachable_regions): Likewise.
>      * region-model-reachability.h: Likewise.
>      * region-model.cc (region_model::handle_unrecognized_call): Likewise.
>      (region_model::get_reachable_svalues): Likewise.
>      (region_model::can_merge_with_p): Likewise.
> ---
>   gcc/analyzer/constraint-manager.cc        | 11 ++++-------
>   gcc/analyzer/constraint-manager.h         |  3 +--
>   gcc/analyzer/program-state.cc             | 22 +++++++++++-----------
>   gcc/analyzer/program-state.h              |  3 +--
>   gcc/analyzer/region-model-reachability.cc |  5 ++---
>   gcc/analyzer/region-model-reachability.h  |  3 +--
>   gcc/analyzer/region-model.cc              |  7 +++----
>   7 files changed, 23 insertions(+), 31 deletions(-)
> 
> diff --git a/gcc/analyzer/constraint-manager.cc b/gcc/analyzer/constraint-manager.cc
> index 603b22811c1..f9fffe45c66 100644
> --- a/gcc/analyzer/constraint-manager.cc
> +++ b/gcc/analyzer/constraint-manager.cc
> @@ -1808,9 +1808,8 @@ class merger_fact_visitor : public fact_visitor
>   {
>   public:
>     merger_fact_visitor (const constraint_manager *cm_b,
> -               constraint_manager *out,
> -               const model_merger &merger)
> -  : m_cm_b (cm_b), m_out (out), m_merger (merger)
> +               constraint_manager *out)
> +  : m_cm_b (cm_b), m_out (out)
>     {}
> 
>     void on_fact (const svalue *lhs, enum tree_code code, const svalue *rhs)
> @@ -1844,7 +1843,6 @@ public:
>   private:
>     const constraint_manager *m_cm_b;
>     constraint_manager *m_out;
> -  const model_merger &m_merger;
>   };
> 
>   /* Use MERGER to merge CM_A and CM_B into *OUT.
> @@ -1856,14 +1854,13 @@ private:
>   void
>   constraint_manager::merge (const constraint_manager &cm_a,
>                  const constraint_manager &cm_b,
> -               constraint_manager *out,
> -               const model_merger &merger)
> +               constraint_manager *out)
>   {
>     /* Merge the equivalence classes and constraints.
>        The easiest way to do this seems to be to enumerate all of the facts
>        in cm_a, see which are also true in cm_b,
>        and add those to *OUT.  */
> -  merger_fact_visitor v (&cm_b, out, merger);
> +  merger_fact_visitor v (&cm_b, out);
>     cm_a.for_each_fact (&v);
>   }
> 
> diff --git a/gcc/analyzer/constraint-manager.h b/gcc/analyzer/constraint-manager.h
> index 98960ffad84..1142b1f06e6 100644
> --- a/gcc/analyzer/constraint-manager.h
> +++ b/gcc/analyzer/constraint-manager.h
> @@ -274,8 +274,7 @@ public:
> 
>     static void merge (const constraint_manager &cm_a,
>                const constraint_manager &cm_b,
> -             constraint_manager *out,
> -             const model_merger &merger);
> +             constraint_manager *out);
> 
>     void for_each_fact (fact_visitor *) const;
> 
> diff --git a/gcc/analyzer/program-state.cc b/gcc/analyzer/program-state.cc
> index 5bb8907e340..77c2de435d6 100644
> --- a/gcc/analyzer/program-state.cc
> +++ b/gcc/analyzer/program-state.cc
> @@ -135,8 +135,8 @@ extrinsic_state::get_model_manager () const
> 
>   /* sm_state_map's ctor.  */
> 
> -sm_state_map::sm_state_map (const state_machine &sm, int sm_idx)
> -: m_sm (sm), m_sm_idx (sm_idx), m_map (), m_global_state (sm.get_start_state ())
> +sm_state_map::sm_state_map (const state_machine &sm)
> +: m_sm (sm), m_map (), m_global_state (sm.get_start_state ())
>   {
>   }
> 
> @@ -577,7 +577,7 @@ program_state::program_state (const extrinsic_state &ext_state)
>     const int num_states = ext_state.get_num_checkers ();
>     for (int i = 0; i < num_states; i++)
>       {
> -      sm_state_map *sm = new sm_state_map (ext_state.get_sm (i), i);
> +      sm_state_map *sm = new sm_state_map (ext_state.get_sm (i));
>         m_checker_states.quick_push (sm);
>       }
>   }
> @@ -1154,7 +1154,7 @@ test_sm_state_map ()
>       const svalue *y_sval = model.get_rvalue (y, NULL);
>       const svalue *z_sval = model.get_rvalue (z, NULL);
> 
> -    sm_state_map map (*sm, 0);
> +    sm_state_map map (*sm);
>       ASSERT_TRUE (map.is_empty_p ());
>       ASSERT_EQ (map.get_state (x_sval, ext_state), start);
> 
> @@ -1183,7 +1183,7 @@ test_sm_state_map ()
>       const svalue *y_sval = model.get_rvalue (y, NULL);
>       const svalue *z_sval = model.get_rvalue (z, NULL);
> 
> -    sm_state_map map (*sm, 0);
> +    sm_state_map map (*sm);
>       ASSERT_TRUE (map.is_empty_p ());
>       ASSERT_EQ (map.get_state (x_sval, ext_state), start);
>       ASSERT_EQ (map.get_state (y_sval, ext_state), start);
> @@ -1206,9 +1206,9 @@ test_sm_state_map ()
>       const svalue *y_sval = model.get_rvalue (y, NULL);
>       const svalue *z_sval = model.get_rvalue (z, NULL);
> 
> -    sm_state_map map0 (*sm, 0);
> -    sm_state_map map1 (*sm, 0);
> -    sm_state_map map2 (*sm, 0);
> +    sm_state_map map0 (*sm);
> +    sm_state_map map1 (*sm);
> +    sm_state_map map2 (*sm);
> 
>       ASSERT_EQ (map0.hash (), map1.hash ());
>       ASSERT_EQ (map0, map1);
> @@ -1229,9 +1229,9 @@ test_sm_state_map ()
>       const state_machine::state_t TEST_STATE_2 = &test_state_2;
>       const state_machine::state test_state_3 ("test state 3", 3);
>       const state_machine::state_t TEST_STATE_3 = &test_state_3;
> -    sm_state_map map0 (*sm, 0);
> -    sm_state_map map1 (*sm, 0);
> -    sm_state_map map2 (*sm, 0);
> +    sm_state_map map0 (*sm);
> +    sm_state_map map1 (*sm);
> +    sm_state_map map2 (*sm);
> 
>       ASSERT_EQ (map0.hash (), map1.hash ());
>       ASSERT_EQ (map0, map1);
> diff --git a/gcc/analyzer/program-state.h b/gcc/analyzer/program-state.h
> index 094d2562656..353cce22844 100644
> --- a/gcc/analyzer/program-state.h
> +++ b/gcc/analyzer/program-state.h
> @@ -102,7 +102,7 @@ public:
>     typedef hash_map <const svalue *, entry_t> map_t;
>     typedef map_t::iterator iterator_t;
> 
> -  sm_state_map (const state_machine &sm, int m_sm_idx);
> +  sm_state_map (const state_machine &sm);
> 
>     sm_state_map *clone () const;
> 
> @@ -163,7 +163,6 @@ public:
> 
>   private:
>     const state_machine &m_sm;
> -  int m_sm_idx;
>     map_t m_map;
>     state_machine::state_t m_global_state;
>   };
> diff --git a/gcc/analyzer/region-model-reachability.cc b/gcc/analyzer/region-model-reachability.cc
> index 3a6b312a8df..bf99cf1d81d 100644
> --- a/gcc/analyzer/region-model-reachability.cc
> +++ b/gcc/analyzer/region-model-reachability.cc
> @@ -58,9 +58,8 @@ along with GCC; see the file COPYING3.  If not see
> 
>   namespace ana {
> 
> -reachable_regions::reachable_regions (region_model *model,
> -                      region_model_manager *mgr)
> -: m_model (model), m_store (model->get_store ()), m_mgr (mgr),
> +reachable_regions::reachable_regions (region_model *model)
> +: m_model (model), m_store (model->get_store ()),
>     m_reachable_base_regs (), m_mutable_base_regs ()
>   {
>   }
> diff --git a/gcc/analyzer/region-model-reachability.h b/gcc/analyzer/region-model-reachability.h
> index fe305b0ce78..4d30c1fdd1d 100644
> --- a/gcc/analyzer/region-model-reachability.h
> +++ b/gcc/analyzer/region-model-reachability.h
> @@ -35,7 +35,7 @@ namespace ana {
>   class reachable_regions
>   {
>   public:
> -  reachable_regions (region_model *model, region_model_manager *mgr);
> +  reachable_regions (region_model *model);
> 
>     /* Callback called for each cluster when initializing this object.  */
>     static void init_cluster_cb (const region *base_reg,
> @@ -97,7 +97,6 @@ public:
>   private:
>     region_model *m_model;
>     store *m_store;
> -  region_model_manager *m_mgr;
> 
>     /* The base regions already seen.  */
>     hash_set<const region *> m_reachable_base_regs;
> diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc
> index 06c0c8668ac..e7f306280c8 100644
> --- a/gcc/analyzer/region-model.cc
> +++ b/gcc/analyzer/region-model.cc
> @@ -836,7 +836,7 @@ region_model::handle_unrecognized_call (const gcall *call,
>   {
>     tree fndecl = get_fndecl_for_call (call, ctxt);
> 
> -  reachable_regions reachable_regs (this, m_mgr);
> +  reachable_regions reachable_regs (this);
> 
>     /* Determine the reachable regions and their mutability.  */
>     {
> @@ -904,7 +904,7 @@ void
>   region_model::get_reachable_svalues (svalue_set *out,
>                        const svalue *extra_sval)
>   {
> -  reachable_regions reachable_regs (this, m_mgr);
> +  reachable_regions reachable_regs (this);
> 
>     /* Add globals and regions that already escaped in previous
>        unknown calls.  */
> @@ -2855,8 +2855,7 @@ region_model::can_merge_with_p (const region_model &other_model,
>     /* Merge constraints.  */
>     constraint_manager::merge (*m_constraints,
>                     *other_model.m_constraints,
> -                  out_model->m_constraints,
> -                  m);
> +                  out_model->m_constraints);
> 
>     return true;
>   }


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] analyzer: remove dead code
@ 2020-10-23 15:26 Martin Liška
  2020-11-09 14:25 ` Martin Liška
  2020-11-10 16:57 ` David Malcolm
  0 siblings, 2 replies; 7+ messages in thread
From: Martin Liška @ 2020-10-23 15:26 UTC (permalink / raw)
  To: gcc-patches

Hey.

I've noticed that when building GCC with Clang.
David what do you think about it?

Thanks,
Martin

gcc/analyzer/ChangeLog:

	* constraint-manager.cc (constraint_manager::merge): Remove
	unused code.
	* constraint-manager.h: Likewise.
	* program-state.cc (sm_state_map::sm_state_map): Likewise.
	(program_state::program_state): Likewise.
	(test_sm_state_map): Likewise.
	* program-state.h: Likewise.
	* region-model-reachability.cc (reachable_regions::reachable_regions): Likewise.
	* region-model-reachability.h: Likewise.
	* region-model.cc (region_model::handle_unrecognized_call): Likewise.
	(region_model::get_reachable_svalues): Likewise.
	(region_model::can_merge_with_p): Likewise.
---
  gcc/analyzer/constraint-manager.cc        | 11 ++++-------
  gcc/analyzer/constraint-manager.h         |  3 +--
  gcc/analyzer/program-state.cc             | 22 +++++++++++-----------
  gcc/analyzer/program-state.h              |  3 +--
  gcc/analyzer/region-model-reachability.cc |  5 ++---
  gcc/analyzer/region-model-reachability.h  |  3 +--
  gcc/analyzer/region-model.cc              |  7 +++----
  7 files changed, 23 insertions(+), 31 deletions(-)

diff --git a/gcc/analyzer/constraint-manager.cc b/gcc/analyzer/constraint-manager.cc
index 603b22811c1..f9fffe45c66 100644
--- a/gcc/analyzer/constraint-manager.cc
+++ b/gcc/analyzer/constraint-manager.cc
@@ -1808,9 +1808,8 @@ class merger_fact_visitor : public fact_visitor
  {
  public:
    merger_fact_visitor (const constraint_manager *cm_b,
-		       constraint_manager *out,
-		       const model_merger &merger)
-  : m_cm_b (cm_b), m_out (out), m_merger (merger)
+		       constraint_manager *out)
+  : m_cm_b (cm_b), m_out (out)
    {}
  
    void on_fact (const svalue *lhs, enum tree_code code, const svalue *rhs)
@@ -1844,7 +1843,6 @@ public:
  private:
    const constraint_manager *m_cm_b;
    constraint_manager *m_out;
-  const model_merger &m_merger;
  };
  
  /* Use MERGER to merge CM_A and CM_B into *OUT.
@@ -1856,14 +1854,13 @@ private:
  void
  constraint_manager::merge (const constraint_manager &cm_a,
  			   const constraint_manager &cm_b,
-			   constraint_manager *out,
-			   const model_merger &merger)
+			   constraint_manager *out)
  {
    /* Merge the equivalence classes and constraints.
       The easiest way to do this seems to be to enumerate all of the facts
       in cm_a, see which are also true in cm_b,
       and add those to *OUT.  */
-  merger_fact_visitor v (&cm_b, out, merger);
+  merger_fact_visitor v (&cm_b, out);
    cm_a.for_each_fact (&v);
  }
  
diff --git a/gcc/analyzer/constraint-manager.h b/gcc/analyzer/constraint-manager.h
index 98960ffad84..1142b1f06e6 100644
--- a/gcc/analyzer/constraint-manager.h
+++ b/gcc/analyzer/constraint-manager.h
@@ -274,8 +274,7 @@ public:
  
    static void merge (const constraint_manager &cm_a,
  		     const constraint_manager &cm_b,
-		     constraint_manager *out,
-		     const model_merger &merger);
+		     constraint_manager *out);
  
    void for_each_fact (fact_visitor *) const;
  
diff --git a/gcc/analyzer/program-state.cc b/gcc/analyzer/program-state.cc
index 5bb8907e340..77c2de435d6 100644
--- a/gcc/analyzer/program-state.cc
+++ b/gcc/analyzer/program-state.cc
@@ -135,8 +135,8 @@ extrinsic_state::get_model_manager () const
  
  /* sm_state_map's ctor.  */
  
-sm_state_map::sm_state_map (const state_machine &sm, int sm_idx)
-: m_sm (sm), m_sm_idx (sm_idx), m_map (), m_global_state (sm.get_start_state ())
+sm_state_map::sm_state_map (const state_machine &sm)
+: m_sm (sm), m_map (), m_global_state (sm.get_start_state ())
  {
  }
  
@@ -577,7 +577,7 @@ program_state::program_state (const extrinsic_state &ext_state)
    const int num_states = ext_state.get_num_checkers ();
    for (int i = 0; i < num_states; i++)
      {
-      sm_state_map *sm = new sm_state_map (ext_state.get_sm (i), i);
+      sm_state_map *sm = new sm_state_map (ext_state.get_sm (i));
        m_checker_states.quick_push (sm);
      }
  }
@@ -1154,7 +1154,7 @@ test_sm_state_map ()
      const svalue *y_sval = model.get_rvalue (y, NULL);
      const svalue *z_sval = model.get_rvalue (z, NULL);
  
-    sm_state_map map (*sm, 0);
+    sm_state_map map (*sm);
      ASSERT_TRUE (map.is_empty_p ());
      ASSERT_EQ (map.get_state (x_sval, ext_state), start);
  
@@ -1183,7 +1183,7 @@ test_sm_state_map ()
      const svalue *y_sval = model.get_rvalue (y, NULL);
      const svalue *z_sval = model.get_rvalue (z, NULL);
  
-    sm_state_map map (*sm, 0);
+    sm_state_map map (*sm);
      ASSERT_TRUE (map.is_empty_p ());
      ASSERT_EQ (map.get_state (x_sval, ext_state), start);
      ASSERT_EQ (map.get_state (y_sval, ext_state), start);
@@ -1206,9 +1206,9 @@ test_sm_state_map ()
      const svalue *y_sval = model.get_rvalue (y, NULL);
      const svalue *z_sval = model.get_rvalue (z, NULL);
  
-    sm_state_map map0 (*sm, 0);
-    sm_state_map map1 (*sm, 0);
-    sm_state_map map2 (*sm, 0);
+    sm_state_map map0 (*sm);
+    sm_state_map map1 (*sm);
+    sm_state_map map2 (*sm);
  
      ASSERT_EQ (map0.hash (), map1.hash ());
      ASSERT_EQ (map0, map1);
@@ -1229,9 +1229,9 @@ test_sm_state_map ()
      const state_machine::state_t TEST_STATE_2 = &test_state_2;
      const state_machine::state test_state_3 ("test state 3", 3);
      const state_machine::state_t TEST_STATE_3 = &test_state_3;
-    sm_state_map map0 (*sm, 0);
-    sm_state_map map1 (*sm, 0);
-    sm_state_map map2 (*sm, 0);
+    sm_state_map map0 (*sm);
+    sm_state_map map1 (*sm);
+    sm_state_map map2 (*sm);
  
      ASSERT_EQ (map0.hash (), map1.hash ());
      ASSERT_EQ (map0, map1);
diff --git a/gcc/analyzer/program-state.h b/gcc/analyzer/program-state.h
index 094d2562656..353cce22844 100644
--- a/gcc/analyzer/program-state.h
+++ b/gcc/analyzer/program-state.h
@@ -102,7 +102,7 @@ public:
    typedef hash_map <const svalue *, entry_t> map_t;
    typedef map_t::iterator iterator_t;
  
-  sm_state_map (const state_machine &sm, int m_sm_idx);
+  sm_state_map (const state_machine &sm);
  
    sm_state_map *clone () const;
  
@@ -163,7 +163,6 @@ public:
  
  private:
    const state_machine &m_sm;
-  int m_sm_idx;
    map_t m_map;
    state_machine::state_t m_global_state;
  };
diff --git a/gcc/analyzer/region-model-reachability.cc b/gcc/analyzer/region-model-reachability.cc
index 3a6b312a8df..bf99cf1d81d 100644
--- a/gcc/analyzer/region-model-reachability.cc
+++ b/gcc/analyzer/region-model-reachability.cc
@@ -58,9 +58,8 @@ along with GCC; see the file COPYING3.  If not see
  
  namespace ana {
  
-reachable_regions::reachable_regions (region_model *model,
-				      region_model_manager *mgr)
-: m_model (model), m_store (model->get_store ()), m_mgr (mgr),
+reachable_regions::reachable_regions (region_model *model)
+: m_model (model), m_store (model->get_store ()),
    m_reachable_base_regs (), m_mutable_base_regs ()
  {
  }
diff --git a/gcc/analyzer/region-model-reachability.h b/gcc/analyzer/region-model-reachability.h
index fe305b0ce78..4d30c1fdd1d 100644
--- a/gcc/analyzer/region-model-reachability.h
+++ b/gcc/analyzer/region-model-reachability.h
@@ -35,7 +35,7 @@ namespace ana {
  class reachable_regions
  {
  public:
-  reachable_regions (region_model *model, region_model_manager *mgr);
+  reachable_regions (region_model *model);
  
    /* Callback called for each cluster when initializing this object.  */
    static void init_cluster_cb (const region *base_reg,
@@ -97,7 +97,6 @@ public:
  private:
    region_model *m_model;
    store *m_store;
-  region_model_manager *m_mgr;
  
    /* The base regions already seen.  */
    hash_set<const region *> m_reachable_base_regs;
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc
index 06c0c8668ac..e7f306280c8 100644
--- a/gcc/analyzer/region-model.cc
+++ b/gcc/analyzer/region-model.cc
@@ -836,7 +836,7 @@ region_model::handle_unrecognized_call (const gcall *call,
  {
    tree fndecl = get_fndecl_for_call (call, ctxt);
  
-  reachable_regions reachable_regs (this, m_mgr);
+  reachable_regions reachable_regs (this);
  
    /* Determine the reachable regions and their mutability.  */
    {
@@ -904,7 +904,7 @@ void
  region_model::get_reachable_svalues (svalue_set *out,
  				     const svalue *extra_sval)
  {
-  reachable_regions reachable_regs (this, m_mgr);
+  reachable_regions reachable_regs (this);
  
    /* Add globals and regions that already escaped in previous
       unknown calls.  */
@@ -2855,8 +2855,7 @@ region_model::can_merge_with_p (const region_model &other_model,
    /* Merge constraints.  */
    constraint_manager::merge (*m_constraints,
  			      *other_model.m_constraints,
-			      out_model->m_constraints,
-			      m);
+			      out_model->m_constraints);
  
    return true;
  }
-- 
2.28.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-02 13:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 10:38 [PATCH] analyzer: remove dead code Martin Liška
2021-03-02 13:38 ` David Malcolm
2021-03-02 13:40   ` Martin Liška
  -- strict thread matches above, loose matches on Subject: below --
2020-10-23 15:26 Martin Liška
2020-11-09 14:25 ` Martin Liška
2020-11-10 16:57 ` David Malcolm
2020-11-10 17:00   ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).