diff options
author | Devang Patel <dpatel@apple.com> | 2004-08-16 13:54:43 -0700 |
---|---|---|
committer | Devang Patel <dpatel@gcc.gnu.org> | 2004-08-16 13:54:43 -0700 |
commit | 8e3e233be0d6e50fcfc1da2c81ad5eb51d974baa (patch) | |
tree | 58140b66c92905176d0b282d72e2e415ec6301bb /gcc/varasm.c | |
parent | 580b3958265f6bca27126b24f20d95c32d00c854 (diff) | |
download | gcc-8e3e233be0d6e50fcfc1da2c81ad5eb51d974baa.zip gcc-8e3e233be0d6e50fcfc1da2c81ad5eb51d974baa.tar.gz gcc-8e3e233be0d6e50fcfc1da2c81ad5eb51d974baa.tar.bz2 |
c-common.c (handle_used_attribute): Set DECL_PRESERVE_P.
* c-common.c (handle_used_attribute): Set DECL_PRESERVE_P.
* print-tree.c (print_node): Print DECL_PRESERVE_P.
* target-def.h (TARGET_ASM_MARK_DECL_PRESERVED): New #define.
(TARGET_ASM_OUT): New member, TARGET_ASM_MARK_DECL_PRESERVED
* target.h (struct gcc_target): New member, mark_decl_preserved.
* hooks.c (hook_void_charptr): Rename to ...
(hook_void_constcharptr): ... new name.
* hooks.h (hook_void_charptr): Rename to ..
(hook_void_constcharptr): ... new name.
* tree.h (DECL_PRESERVE_P): New #define.
(struct tree_decl): New member, preserve_flag.
* varasm.c (assemble_start_function): Mark decl preserved.
(assemble_variable): Same.
* darwin.c (darwin_mark_decl_preserved): New function.
* darwin.h (TARGET_ASM_MARK_DECL_preserved): New #define.
* darwin-protos.h (darwin_mark_decl_preserved): New decl.
* doc/tm.texi (TARGET_ASM_MARK_DECL_PRESERVED): Document.
testsuite:
* gcc.dg/darwin-20040809-1.c: New test.
From-SVN: r86076
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index afbde92..5dbcb22 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1222,6 +1222,9 @@ assemble_start_function (tree decl, const char *fnname) maybe_assemble_visibility (decl); } + if (DECL_PRESERVE_P (decl)) + targetm.asm_out.mark_decl_preserved (fnname); + /* Do any machine/system dependent processing of the function name. */ #ifdef ASM_DECLARE_FUNCTION_NAME ASM_DECLARE_FUNCTION_NAME (asm_out_file, fnname, current_function_decl); @@ -1562,6 +1565,9 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED, if (TREE_PUBLIC (decl)) maybe_assemble_visibility (decl); + if (DECL_PRESERVE_P (decl)) + targetm.asm_out.mark_decl_preserved (name); + /* Output any data that we will need to use the address of. */ if (DECL_INITIAL (decl) == error_mark_node) reloc = contains_pointers_p (TREE_TYPE (decl)) ? 3 : 0; |