]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/analyzer/diagnostic-manager.h
Update copyright years.
[thirdparty/gcc.git] / gcc / analyzer / diagnostic-manager.h
index 34abf56d11faf87f3b487b7aca5d1c53bb0fdc9d..9b3e903fc5d91fdb7e0d6c522d9f47189335aab3 100644 (file)
@@ -1,5 +1,5 @@
 /* Classes for saving, deduplicating, and emitting analyzer diagnostics.
-   Copyright (C) 2019-2022 Free Software Foundation, Inc.
+   Copyright (C) 2019-2023 Free Software Foundation, Inc.
    Contributed by David Malcolm <dmalcolm@redhat.com>.
 
 This file is part of GCC.
@@ -33,26 +33,28 @@ public:
   saved_diagnostic (const state_machine *sm,
                    const exploded_node *enode,
                    const supernode *snode, const gimple *stmt,
-                   stmt_finder *stmt_finder,
+                   const stmt_finder *stmt_finder,
                    tree var, const svalue *sval,
                    state_machine::state_t state,
-                   pending_diagnostic *d,
+                   std::unique_ptr<pending_diagnostic> d,
                    unsigned idx);
-  ~saved_diagnostic ();
 
   bool operator== (const saved_diagnostic &other) const;
 
-  void add_note (pending_note *pn);
+  void add_note (std::unique_ptr<pending_note> pn);
 
   json::object *to_json () const;
 
+  void dump_dot_id (pretty_printer *pp) const;
+  void dump_as_dot_node (pretty_printer *pp) const;
+
   const feasibility_problem *get_feasibility_problem () const
   {
-    return m_problem;
+    return m_problem.get ();
   }
 
   bool calc_best_epath (epath_finder *pf);
-  const exploded_path *get_best_epath () const { return m_best_epath; }
+  const exploded_path *get_best_epath () const { return m_best_epath.get (); }
   unsigned get_epath_length () const;
 
   void add_duplicate (saved_diagnostic *other);
@@ -69,19 +71,19 @@ public:
   const exploded_node *m_enode;
   const supernode *m_snode;
   const gimple *m_stmt;
-  stmt_finder *m_stmt_finder;
+  std::unique_ptr<stmt_finder> m_stmt_finder;
   tree m_var;
   const svalue *m_sval;
   state_machine::state_t m_state;
-  pending_diagnostic *m_d; // owned
+  std::unique_ptr<pending_diagnostic> m_d;
   const exploded_edge *m_trailing_eedge;
 
 private:
   DISABLE_COPY_AND_ASSIGN (saved_diagnostic);
 
   unsigned m_idx;
-  exploded_path *m_best_epath; // owned
-  feasibility_problem *m_problem; // owned
+  std::unique_ptr<exploded_path> m_best_epath;
+  std::unique_ptr<feasibility_problem> m_problem;
 
   auto_vec<const saved_diagnostic *> m_duplicates;
   auto_delete_vec <pending_note> m_notes;
@@ -107,21 +109,21 @@ public:
 
   json::object *to_json () const;
 
-  void add_diagnostic (const state_machine *sm,
+  bool add_diagnostic (const state_machine *sm,
                       exploded_node *enode,
                       const supernode *snode, const gimple *stmt,
-                      stmt_finder *finder,
+                      const stmt_finder *finder,
                       tree var,
                       const svalue *sval,
                       state_machine::state_t state,
-                      pending_diagnostic *d);
+                      std::unique_ptr<pending_diagnostic> d);
 
-  void add_diagnostic (exploded_node *enode,
+  bool add_diagnostic (exploded_node *enode,
                       const supernode *snode, const gimple *stmt,
-                      stmt_finder *finder,
-                      pending_diagnostic *d);
+                      const stmt_finder *finder,
+                      std::unique_ptr<pending_diagnostic> d);
 
-  void add_note (pending_note *pn);
+  void add_note (std::unique_ptr<pending_note> pn);
 
   void emit_saved_diagnostics (const exploded_graph &eg);
 
@@ -146,6 +148,11 @@ private:
                            const exploded_path &epath,
                            checker_path *emission_path) const;
 
+  void add_event_on_final_node (const path_builder &pb,
+                               const exploded_node *final_enode,
+                               checker_path *emission_path,
+                               interesting_t *interest) const;
+
   void add_events_for_eedge (const path_builder &pb,
                             const exploded_edge &eedge,
                             checker_path *emission_path,