diff options
author | Zack Weinberg <zack@codesourcery.com> | 2004-05-19 01:28:56 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2004-05-19 01:28:56 +0000 |
commit | bb9a388dad84486a075d822e4bed05a74faab780 (patch) | |
tree | 3b98c8b6def01f3ffef6ee0dc67f9968797dce2e /gcc/varasm.c | |
parent | 5b200ac2c7278c022c23a684589df1b31a40a153 (diff) | |
download | gcc-bb9a388dad84486a075d822e4bed05a74faab780.zip gcc-bb9a388dad84486a075d822e4bed05a74faab780.tar.gz gcc-bb9a388dad84486a075d822e4bed05a74faab780.tar.bz2 |
* cgraph.c (hash_node, eq_node, cgraph_node, cgraph_remove_node)
(cgraph_varpool_hash_node, eq_cgraph_varpool_node)
(cgraph_varpool_node):
Use DECL_UID for the key, not DECL_ASSEMBLER_NAME.
(cgraph_function_possibly_inlined_p): Use the decl itself for
the key, not DECL_ASSEMBLER_NAME.
(change_decl_assembler_name): No need to muck with the hash tables.
(cgraph_node_for_identifier, cgraph_varpool_node_for_identifier):
Delete.
* cgraphunit.c (cgraph_mark_inline_edge): Use the decl itself
for the key, not DECL_ASSEMBLER_NAME.
* cgraph.h: Remove prototypes of deleted functions.
* varasm.c (mark_referenced): Just set TREE_SYMBOL_REFERENCED.
(mark_decl_referenced): New function.
* tree.h: Prototype mark_decl_referenced.
* final.c (output_addr_const) <case SYMBOL_REF>: Call
mark_decl_referenced before assemble_name.
* c-decl.c (finish_decl): Use mark_decl_referenced.
cp:
* decl.c (cp_finish_decl): Use mark_decl_referenced.
* decl2.c (maybe_make_one_only): Likewise.
* method.c (use_thunk): Likewise.
From-SVN: r82015
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 4b59129..96d264a 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1685,29 +1685,25 @@ assemble_label (const char *name) ASM_OUTPUT_LABEL (asm_out_file, name); } -/* Set the symbol_referenced flag for ID and notify callgraph code. */ +/* Set the symbol_referenced flag for ID. */ void mark_referenced (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); - } - - vnode = cgraph_varpool_node_for_identifier (id); - if (vnode) - cgraph_varpool_mark_needed_node (vnode); - } TREE_SYMBOL_REFERENCED (id) = 1; } +/* Set the symbol_referenced flag for DECL and notify callgraph. */ +void +mark_decl_referenced (tree decl) +{ + if (TREE_CODE (decl) == FUNCTION_DECL) + cgraph_mark_needed_node (cgraph_node (decl)); + else if (TREE_CODE (decl) == VAR_DECL) + cgraph_varpool_mark_needed_node (cgraph_varpool_node (decl)); + /* else do nothing - we can get various sorts of CST nodes here, + which do not need to be marked. */ +} + /* 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 |