public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Andreas Schwab <schwab@linux-m68k.org>, gcc-patches@gcc.gnu.org
Subject: [PATCH] analyzer: implement exploded_path copy ctor
Date: Fri, 26 Feb 2021 11:00:07 -0500	[thread overview]
Message-ID: <20210226160007.2256674-1-dmalcolm@redhat.com> (raw)
In-Reply-To: <87wnuvqj08.fsf@igel.home>

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(-)

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 (); }
 
-- 
2.26.2


  reply	other threads:[~2021-02-26 16:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26  1:02 [committed] analyzer: eliminate dedupe_candidate [PR96374] David Malcolm
2021-02-26  9:24 ` Andreas Schwab
2021-02-26 16:00   ` David Malcolm [this message]
2021-02-26 18:33     ` [PATCH] analyzer: implement exploded_path copy ctor Andreas Schwab
2021-02-26 21:39       ` David Malcolm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210226160007.2256674-1-dmalcolm@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).