+Thu Jun 26 00:13:35 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * c-common.c (handle_used_attribute): Use mark_referenced.
+ * varasm.c (mark_referenced): Break out from ...
+ (assemble_name): ... here.
+ * tree.h (mark_referenced): Declare.
+
2003-06-25 Wolfgang Bangerth <bangerth@dealii.org>
* gccbug.in: Add PCH to list of categories.
if (TREE_CODE (node) == FUNCTION_DECL
|| (TREE_CODE (node) == VAR_DECL && TREE_STATIC (node)))
- TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (node))
- = TREE_USED (node) = 1;
+ {
+ mark_referenced (DECL_ASSEMBLER_NAME (node));
+ TREE_USED (node) = 1;
+ }
else
{
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
enum tls_model decl_tls_model PARAMS ((tree));
enum symbol_visibility decl_visibility PARAMS ((tree));
extern void resolve_unique_section PARAMS ((tree, int, int));
+extern void mark_referenced PARAMS ((tree));
/* In stmt.c */
extern void emit_nop PARAMS ((void));
ASM_OUTPUT_LABEL (asm_out_file, name);
}
+/* Set the symbol_referenced flag for ID and notify callgraph code. */
+void
+mark_referenced (id)
+ tree id;
+{
+ if (!TREE_SYMBOL_REFERENCED (id))
+ {
+ struct cgraph_node *node;
+ struct cgraph_varpool_node *vnode;
+
+ if (!cgraph_global_info_ready)
+ {
+ node = cgraph_node_for_identifier (id);
+ if (node)
+ cgraph_mark_needed_node (node, 1);
+ }
+
+ vnode = cgraph_varpool_node_for_identifier (id);
+ if (vnode)
+ cgraph_varpool_mark_needed_node (vnode);
+ }
+ TREE_SYMBOL_REFERENCED (id) = 1;
+}
+
/* Output to FILE a reference to the assembler name of a C-level name NAME.
If NAME starts with a *, the rest of NAME is output verbatim.
Otherwise NAME is transformed in an implementation-defined way
id = maybe_get_identifier (real_name);
if (id)
- {
- if (!TREE_SYMBOL_REFERENCED (id))
- {
- struct cgraph_node *node;
- struct cgraph_varpool_node *vnode;
-
- if (!cgraph_global_info_ready)
- {
- node = cgraph_node_for_identifier (id);
- if (node)
- cgraph_mark_needed_node (node, 1);
- }
-
- vnode = cgraph_varpool_node_for_identifier (id);
- if (vnode)
- cgraph_varpool_mark_needed_node (vnode);
- }
- TREE_SYMBOL_REFERENCED (id) = 1;
- }
+ mark_referenced (id);
if (name[0] == '*')
fputs (&name[1], file);