summaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-12 13:31:39 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-12 13:31:39 +0000
commita55dd2315b949e25ab4db542d7943fdf0dc08fd4 (patch)
tree745ccdb3fdb8a6e02012ff1e00510d61d453fb5e /gcc/cgraph.c
parentf2b3312b1728bd75bbae7041d7d7894bf3c3a76b (diff)
downloadgcc-a55dd2315b949e25ab4db542d7943fdf0dc08fd4.tar.gz
2009-06-12 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r148428 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@148430 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index fe1126bca91..640d180f29b 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -701,8 +701,9 @@ cgraph_create_edge_including_clones (struct cgraph_node *orig, struct cgraph_nod
{
struct cgraph_node *node;
- cgraph_create_edge (orig, callee, stmt, count, freq, loop_depth)->inline_failed =
- reason;
+ if (!cgraph_edge (orig, stmt))
+ cgraph_create_edge (orig, callee, stmt,
+ count, freq, loop_depth)->inline_failed = reason;
if (orig->clones)
for (node = orig->clones; node != orig;)
@@ -1870,4 +1871,32 @@ cgraph_add_new_function (tree fndecl, bool lowered)
}
}
+/* Return true if NODE can be made local for API change.
+ Extern inline functions and C++ COMDAT functions can be made local
+ at the expense of possible code size growth if function is used in multiple
+ compilation units. */
+bool
+cgraph_node_can_be_local_p (struct cgraph_node *node)
+{
+ return !node->needed;
+}
+
+/* Bring NODE local. */
+void
+cgraph_make_node_local (struct cgraph_node *node)
+{
+ gcc_assert (cgraph_node_can_be_local_p (node));
+ if (DECL_COMDAT (node->decl) || DECL_EXTERNAL (node->decl))
+ {
+ DECL_COMDAT (node->decl) = 0;
+ DECL_ONE_ONLY (node->decl) = 0;
+ TREE_PUBLIC (node->decl) = 0;
+ DECL_WEAK (node->decl) = 0;
+ DECL_EXTERNAL (node->decl) = 0;
+ node->local.externally_visible = false;
+ node->local.local = true;
+ gcc_assert (cgraph_function_body_availability (node) == AVAIL_LOCAL);
+ }
+}
+
#include "gt-cgraph.h"