aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-06-26 00:14:26 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2003-06-25 22:14:26 +0000
commit4d7d0451bcd5437c1a0c2c852784427e87297024 (patch)
tree6bb2629ee62f198c4d510aa1649411077fcadf74 /gcc/varasm.c
parent6322fdd83b824be16b3d492a5897246db2ac9efd (diff)
downloadgcc-4d7d0451bcd5437c1a0c2c852784427e87297024.zip
gcc-4d7d0451bcd5437c1a0c2c852784427e87297024.tar.gz
gcc-4d7d0451bcd5437c1a0c2c852784427e87297024.tar.bz2
c-common.c (handle_used_attribute): Use mark_referenced.
* c-common.c (handle_used_attribute): Use mark_referenced. * varasm.c (mark_referenced): Break out from ... (assemble_name): ... here. * tree.h (mark_referenced): Declare. From-SVN: r68500
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index c2bd4b3..7519138 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1728,6 +1728,30 @@ assemble_label (name)
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
@@ -1746,25 +1770,7 @@ assemble_name (file, name)
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);