From ca3f25c1fb9bbf0d807985baee460670b7f195b4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 21 Mar 2009 08:24:40 +0000 Subject: fix several problems with asm renaming, by pulling it into the mangling code: 1. it wasn't applying to definitions, only declarations, e.g. int x __asm("foo") 2. multiple definitions were conflicting, they weren't getting merged. 3. the code was duplicated in several places. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67442 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index c46db96bad..97f989dbe3 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -305,11 +305,6 @@ void CodeGenModule::SetGlobalValueAttributes(const Decl *D, setGlobalVisibility(GV, attr->getVisibility()); // FIXME: else handle -fvisibility - // Prefaced with special LLVM marker to indicate that the name - // should not be munged. - if (const AsmLabelAttr *ALA = D->getAttr()) - GV->setName("\01" + ALA->getLabel()); - if (const SectionAttr *SA = D->getAttr()) GV->setSection(SA->getName()); @@ -629,12 +624,6 @@ void CodeGenModule::EmitGlobalDefinition(const ValueDecl *D) { if (D->getAttr() || D->getAttr()) GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage); - // FIXME: This should be handled by the mangler! - if (const AsmLabelAttr *ALA = D->getAttr()) { - // Prefaced with special LLVM marker to indicate that the name - // should not be munged. - GV->setName("\01" + ALA->getLabel()); - } return Entry = GV; } @@ -746,13 +735,6 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { setGlobalVisibility(GV, attr->getVisibility()); // FIXME: else handle -fvisibility - // FIXME: This should be a mangling issue. - if (const AsmLabelAttr *ALA = D->getAttr()) { - // Prefaced with special LLVM marker to indicate that the name - // should not be munged. - GV->setName("\01" + ALA->getLabel()); - } - // Set the llvm linkage type as appropriate. if (D->getStorageClass() == VarDecl::Static) GV->setLinkage(llvm::Function::InternalLinkage); -- cgit v1.2.3-18-g5258