Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Issue #106 - [ARM] pragma(mangle) not working if -fsection-anchors is…
Browse files Browse the repository at this point in the history
… enabled
  • Loading branch information
ibuclaw committed Feb 15, 2014
1 parent 79ebb4c commit 942298f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
4 changes: 4 additions & 0 deletions gcc/d/ChangeLog
Expand Up @@ -10,6 +10,10 @@
prettyIdent, this has already been done in Declaration::toSymbol.
(d_finish_function): Likewise.

* d-decls.cc(VarDeclaration::toSymbol): Call set_user_assembler_name
if pragma(mangle) was seen.
(FuncDeclaration::toSymbol): Likewise.

2014-02-12 Johannes Pfau <johannespfau@gmail.com>

* d-decls.cc(FuncDeclaration::toSymbol): Do not set TREE_NOTHROW on
Expand Down
25 changes: 18 additions & 7 deletions gcc/d/d-decls.cc
Expand Up @@ -144,12 +144,18 @@ VarDeclaration::toSymbol (void)

if (isDataseg())
{
tree mangle = get_identifier (csym->Sident);
if (this->mangleOverride)
set_user_assembler_name (decl, this->mangleOverride);
else
{
tree mangle = get_identifier (csym->Sident);

if (protection == PROTpublic || storage_class & (STCstatic | STCextern))
mangle = targetm.mangle_decl_assembler_name (decl, mangle);
if (protection == PROTpublic || storage_class & (STCstatic | STCextern))
mangle = targetm.mangle_decl_assembler_name (decl, mangle);

SET_DECL_ASSEMBLER_NAME (decl, mangle);
}

SET_DECL_ASSEMBLER_NAME (decl, mangle);
setup_symbol_storage (this, decl, false);
}

Expand Down Expand Up @@ -340,9 +346,14 @@ FuncDeclaration::toSymbol (void)

if (ident)
{
tree mangle = get_identifier (csym->Sident);
mangle = targetm.mangle_decl_assembler_name (fndecl, mangle);
SET_DECL_ASSEMBLER_NAME (fndecl, mangle);
if (this->mangleOverride)
set_user_assembler_name (fndecl, this->mangleOverride);
else
{
tree mangle = get_identifier (csym->Sident);
mangle = targetm.mangle_decl_assembler_name (fndecl, mangle);
SET_DECL_ASSEMBLER_NAME (fndecl, mangle);
}
}

if (vindex)
Expand Down

0 comments on commit 942298f

Please sign in to comment.