diff mbox series

analyzer: implement exploded_path copy ctor

Message ID 20210226160007.2256674-1-dmalcolm@redhat.com
State New
Headers show
Series analyzer: implement exploded_path copy ctor | expand

Commit Message

David Malcolm Feb. 26, 2021, 4 p.m. UTC
On Fri, 2021-02-26 at 10:24 +0100, Andreas Schwab wrote:
> I'm getting this link failure for all compilers:
> 
> analyzer/diagnostic-manager.o: In function
> `ana::diagnostic_manager::emit_saved_diagnostics(ana::exploded_graph
> const&)':
> diagnostic-manager.cc:(.text+0xd350): undefined reference to
> `ana::exploded_path::exploded_path(ana::exploded_path const&)'
> 
> Andreas.

Sorry about the breakage.

What compiler are you using?
I'm not seeing this (with gcc 4.8.5, or gcc 10.2.1).

Does the following patch fix the build for you?

gcc/analyzer/ChangeLog:
	* engine.cc (exploded_path::exploded_path): New copy-ctor.
	* exploded-graph.h (exploded_path::operator=): Drop decl.
---
 gcc/analyzer/engine.cc        | 9 +++++++++
 gcc/analyzer/exploded-graph.h | 1 -
 2 files changed, 9 insertions(+), 1 deletion(-)

Comments

Andreas Schwab Feb. 26, 2021, 6:33 p.m. UTC | #1
On Feb 26 2021, David Malcolm wrote:

> What compiler are you using?

gcc 5.3.1

> Does the following patch fix the build for you?

Yes, it does.

Andreas.
David Malcolm Feb. 26, 2021, 9:39 p.m. UTC | #2
On Fri, 2021-02-26 at 19:33 +0100, Andreas Schwab wrote:
> On Feb 26 2021, David Malcolm wrote:
> 
> > What compiler are you using?
> 
> gcc 5.3.1
> 
> > Does the following patch fix the build for you?
> 
> Yes, it does.

Thanks.  I've pushed the patch to trunk.

Sorry again for the breakage.

Dave
diff mbox series

Patch

diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 7580f0ba57a..76e2069c935 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -3411,6 +3411,15 @@  exploded_graph::to_json () const
   return egraph_obj;
 }
 
+exploded_path::exploded_path (const exploded_path &other)
+: m_edges (other.m_edges.length ())
+{
+  int i;
+  const exploded_edge *eedge;
+  FOR_EACH_VEC_ELT (other.m_edges, i, eedge)
+    m_edges.quick_push (eedge);
+}
+
 /* Look for the last use of SEARCH_STMT within this path.
    If found write the edge's index to *OUT_IDX and return true, otherwise
    return false.  */
diff --git a/gcc/analyzer/exploded-graph.h b/gcc/analyzer/exploded-graph.h
index 45943093434..bcf58557de2 100644
--- a/gcc/analyzer/exploded-graph.h
+++ b/gcc/analyzer/exploded-graph.h
@@ -867,7 +867,6 @@  class exploded_path
 public:
   exploded_path () : m_edges () {}
   exploded_path (const exploded_path &other);
-  exploded_path & operator= (const exploded_path &other);
 
   unsigned length () const { return m_edges.length (); }