aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2019-03-07 17:03:34 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2019-03-07 17:03:34 +0100
commit1738b52201b1ce28c9f869646f5412b8937ccfe6 (patch)
treecdb71e52faf06fd59ef5c90c4cebf832ea238b09 /gcc/cgraph.h
parent606711a1671cc63713b893c4557df967a5a6ac20 (diff)
downloadgcc-1738b52201b1ce28c9f869646f5412b8937ccfe6.zip
gcc-1738b52201b1ce28c9f869646f5412b8937ccfe6.tar.gz
gcc-1738b52201b1ce28c9f869646f5412b8937ccfe6.tar.bz2
Relax cgraph_node::clone_of_p to also look through former clones
2019-03-07 Martin Jambor <mjambor@suse.cz> PR ipa/88235 * cgraph.h (cgraph_node): New inline method former_thunk_p. * cgraph.c (cgraph_node::dump): Dump a note if node is a former thunk. (clone_of_p): Treat expanded thunks like thunks, be optimistic if they have multiple callees. At the end check if declarations match as opposed to cgraph_nodes. testsuite/ * g++.dg/ipa/pr88235.C: New test. From-SVN: r269462
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index c294602..9a19d83 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1283,6 +1283,9 @@ public:
Note that at WPA stage, the function body may not be present in memory. */
inline bool has_gimple_body_p (void);
+ /* Return true if this node represents a former, i.e. an expanded, thunk. */
+ inline bool former_thunk_p (void);
+
/* Return true if function should be optimized for size. */
bool optimize_for_size_p (void);
@@ -2921,6 +2924,17 @@ cgraph_node::has_gimple_body_p (void)
return definition && !thunk.thunk_p && !alias;
}
+/* Return true if this node represents a former, i.e. an expanded, thunk. */
+
+inline bool
+cgraph_node::former_thunk_p (void)
+{
+ return (!thunk.thunk_p
+ && (thunk.fixed_offset
+ || thunk.virtual_offset_p
+ || thunk.indirect_offset));
+}
+
/* Walk all functions with body defined. */
#define FOR_EACH_FUNCTION_WITH_GIMPLE_BODY(node) \
for ((node) = symtab->first_function_with_gimple_body (); (node); \