+2012-12-22 Jan Hubicka <jh@suse.cz>
+
+ PR lto/54728
+ * cgraph.h (symtab_real_symbol_p): Drop code looking for external functions.
+ * lto-streamer-out.c (output_symbol_p): New function.
+ (produce_symtab) Use it.
+
2012-12-21 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/55355
symtab_real_symbol_p (symtab_node node)
{
struct cgraph_node *cnode;
- struct ipa_ref *ref;
if (!is_a <cgraph_node> (node))
return true;
return false;
if (cnode->abstract_and_needed)
return false;
- /* We keep virtual clones in symtab. */
- if (!cnode->analyzed
- || DECL_EXTERNAL (cnode->symbol.decl))
- return (cnode->callers
- || ipa_ref_list_referring_iterate (&cnode->symbol.ref_list, 0, ref));
return true;
}
#endif /* GCC_CGRAPH_H */
lto_output_data_stream (stream, &slot_num, 4);
}
+/* Return true if NODE should appear in the plugin symbol table. */
+
+bool
+output_symbol_p (symtab_node node)
+{
+ struct cgraph_node *cnode;
+ struct ipa_ref *ref;
+
+ if (!symtab_real_symbol_p (node))
+ return false;
+ /* We keep external functions in symtab for sake of inlining
+ and devirtualization. We do not want to see them in symbol table as
+ references. */
+ cnode = dyn_cast <cgraph_node> (node);
+ if (cnode && DECL_EXTERNAL (cnode->symbol.decl))
+ return (cnode->callers
+ || ipa_ref_list_referring_iterate (&cnode->symbol.ref_list, 0, ref));
+ return true;
+}
+
/* Write an IL symbol table to OB.
SET and VSET are cgraph/varpool node sets we are outputting. */
{
symtab_node node = lsei_node (lsei);
- if (!symtab_real_symbol_p (node) || DECL_EXTERNAL (node->symbol.decl))
+ if (!output_symbol_p (node) || DECL_EXTERNAL (node->symbol.decl))
continue;
write_symbol (cache, &stream, node->symbol.decl, seen, false);
}
{
symtab_node node = lsei_node (lsei);
- if (!symtab_real_symbol_p (node) || !DECL_EXTERNAL (node->symbol.decl))
+ if (!output_symbol_p (node) || !DECL_EXTERNAL (node->symbol.decl))
continue;
write_symbol (cache, &stream, node->symbol.decl, seen, false);
}