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

Commit

Permalink
Have faith in the frontend doing the right thing when it comes to emi…
Browse files Browse the repository at this point in the history
…tting COMDAT symbols
  • Loading branch information
ibuclaw committed Feb 18, 2014
1 parent cfb66ce commit 1a9ee14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
7 changes: 7 additions & 0 deletions gcc/d/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2014-02-18 Iain Buclaw <ibuclaw@gdcproject.org>

* d-objfile.cc(VarDeclaration::toObjFile): Remove toplevel check.
DECL_CONTEXT is never set on manifest constants.
(d_finish_compilation): Remove fancy check on force outputting
symbols to object file.

2014-02-17 Iain Buclaw <ibuclaw@gdcproject.org>

* d-codegen.cc(d_build_module): New function.
Expand Down
16 changes: 3 additions & 13 deletions gcc/d/d-objfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -731,11 +731,7 @@ VarDeclaration::toObjFile (int)
d_pushdecl (decl);
d_keep (decl);

bool toplevel = !DECL_CONTEXT (decl);
if (toplevel)
d_add_global_declaration (decl);

rest_of_decl_compilation (decl, toplevel, 0);
rest_of_decl_compilation (decl, 1, 0);
return;
}

Expand Down Expand Up @@ -1915,22 +1911,16 @@ d_finish_compilation (tree *vec, int len)
tree decl = vec[i];

// Determine if a global var/function is needed.
// For templates, this means if we took the address of the decl,
// or if the decl is a class member/method or public toplevel symbol.
int needed = wrapup_global_declarations (&decl, 1);

if ((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
|| TREE_CODE (decl) == FUNCTION_DECL)
{
tree name = DECL_ASSEMBLER_NAME (decl);

// Don't emit, assembler name already in symtab.
tree name = DECL_ASSEMBLER_NAME (decl);
if (!symtab->insert (IDENTIFIER_POINTER (name), IDENTIFIER_LENGTH (name)))
needed = 0;
else if ((D_DECL_IS_TEMPLATE (decl) || D_DECL_ONE_ONLY (decl))
&& TREE_PUBLIC (decl)
&& (TREE_ADDRESSABLE (decl) || !DECL_CONTEXT (decl)
|| decl_type_context (decl)))
else
needed = 1;
}

Expand Down

0 comments on commit 1a9ee14

Please sign in to comment.