cgraph.c (ld_plugin_symbol_resolution_names): New.
authorJan Hubicka <jh@suse.cz>
Sat, 20 Nov 2010 20:57:31 +0000 (21:57 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 20 Nov 2010 20:57:31 +0000 (20:57 +0000)
* cgraph.c (ld_plugin_symbol_resolution_names): New.
(dump_cgraph_node): Dump resolution.
* cgraph.h (ld_plugin_symbol_resolution_names): Declare.
(cgraph_comdat_can_be_unshared_p): Dclare.
* lto-streamer-out.c (produce_symtab): Use
cgraph_comdat_can_be_unshared_p.
* ipa.c (cgraph_address_taken_from_non_vtable_p): New function.
(cgraph_comdat_can_be_unshared_p): New function based on logic
in cgraph_externally_visible_p.
(cgraph_externally_visible_p): Use it.
(varpool_externally_visible_p): Virtual tables can be unshared.
* varpool.c (dump_varpool_node): Dump resolution.

From-SVN: r166984

gcc/ChangeLog
gcc/cgraph.c

index aea6f594283deadd7d39611f0950993d8b6f6b7c..3fd3ae1c2a7840d551184e583b8306d7fa70f9fa 100644 (file)
@@ -1,3 +1,18 @@
+2010-11-20  Jan Hubicka  <jh@suse.cz>
+
+       * cgraph.c (ld_plugin_symbol_resolution_names): New.
+       (dump_cgraph_node): Dump resolution.
+       * cgraph.h (ld_plugin_symbol_resolution_names): Declare.
+       (cgraph_comdat_can_be_unshared_p): Dclare.
+       * lto-streamer-out.c (produce_symtab): Use
+       cgraph_comdat_can_be_unshared_p.
+       * ipa.c (cgraph_address_taken_from_non_vtable_p): New function.
+       (cgraph_comdat_can_be_unshared_p): New function based on logic
+       in cgraph_externally_visible_p.
+       (cgraph_externally_visible_p): Use it.
+       (varpool_externally_visible_p): Virtual tables can be unshared.
+       * varpool.c (dump_varpool_node): Dump resolution.
+
 2010-11-20  Jan Hubicka  <jh@suse.cz>
 
        * stmt.c (lshift_cheap_p): Support properly optimize_insn_for_speed_p.
index fbeb09430b6a94e0e944341fe507cf1eb7077dc6..36bb87ad928810cdc31528c8c589225edb92b811 100644 (file)
@@ -99,6 +99,19 @@ The callgraph:
 #include "ipa-utils.h"
 #include "lto-streamer.h"
 
+const char * const ld_plugin_symbol_resolution_names[]=
+{
+  "",
+  "undef",
+  "prevailing_def",
+  "prevailing_def_ironly",
+  "preempted_reg",
+  "preempted_ir",
+  "resolved_ir",
+  "resolved_exec",
+  "resolved_dyn"
+};
+
 static void cgraph_node_remove_callers (struct cgraph_node *node);
 static inline void cgraph_edge_remove_caller (struct cgraph_edge *e);
 static inline void cgraph_edge_remove_callee (struct cgraph_edge *e);
@@ -1866,6 +1879,9 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
     fprintf (f, " local");
   if (node->local.externally_visible)
     fprintf (f, " externally_visible");
+  if (node->resolution != LDPR_UNKNOWN)
+    fprintf (f, " %s",
+            ld_plugin_symbol_resolution_names[(int)node->resolution]);
   if (node->local.finalized)
     fprintf (f, " finalized");
   if (node->local.disregard_inline_limits)