analyzer: remove dead code

Message ID 01c00ffa-5b4e-1770-ca32-92ce945859f7@suse.cz
State New
Headers show
Series
  • analyzer: remove dead code
Related show

Commit Message

Martin Liška March 2, 2021, 10:38 a.m.
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(-)

-- 
2.30.1

Comments

Richard Sandiford via Gcc-patches March 2, 2021, 1:38 p.m. | #1
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
Martin Liška March 2, 2021, 1:40 p.m. | #2
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

> 

>

Patch

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;