aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorMark Mitchell <mmitchel@gcc.gnu.org>2004-09-22 02:24:06 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-09-22 02:24:06 +0000
commit1ae57298f9397b3a8476060f57045838847af293 (patch)
tree04a7f9bcf80cff25bb0471a503a7df47aef54770 /gcc/c-decl.c
parentad9f20cbce22c10f62d7f4c1b12d42b144454760 (diff)
downloadgcc-1ae57298f9397b3a8476060f57045838847af293.zip
gcc-1ae57298f9397b3a8476060f57045838847af293.tar.gz
gcc-1ae57298f9397b3a8476060f57045838847af293.tar.bz2
c-decl.c (implicitly_declare): Call maybe_apply_renaming_pragma.
* c-decl.c (implicitly_declare): Call maybe_apply_renaming_pragma. (finish_decl): Likewise. From-SVN: r87840
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 76c1a08..98f1580 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2159,6 +2159,8 @@ implicitly_declare (tree functionid)
{
struct c_binding *b;
tree decl = 0;
+ tree asmspec_tree;
+
for (b = I_SYMBOL_BINDING (functionid); b; b = b->shadowed)
{
if (B_IN_SCOPE (b, external_scope))
@@ -2230,6 +2232,9 @@ implicitly_declare (tree functionid)
TREE_PUBLIC (decl) = 1;
C_DECL_IMPLICIT (decl) = 1;
implicit_decl_warning (functionid, 0);
+ asmspec_tree = maybe_apply_renaming_pragma (decl, /*asmname=*/NULL);
+ if (asmspec_tree)
+ set_user_assembler_name (decl, TREE_STRING_POINTER (asmspec_tree));
/* C89 says implicit declarations are in the innermost block.
So we record the decl in the standard fashion. */
@@ -3064,7 +3069,8 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
const char *asmspec = 0;
/* If a name was specified, get the string. */
- if (current_scope == file_scope)
+ if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
+ && DECL_FILE_SCOPE_P (decl))
asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree);
if (asmspec_tree)
asmspec = TREE_STRING_POINTER (asmspec_tree);