diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-21 08:24:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-21 08:24:40 +0000 |
commit | ca3f25c1fb9bbf0d807985baee460670b7f195b4 (patch) | |
tree | 4eefdaba5322484a2fc0bd15c486ed7f0d5301b4 /lib/CodeGen/CodeGenModule.cpp | |
parent | 2d58406872e5af0c924623d9f7c194c4f09936d3 (diff) |
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
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
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<AsmLabelAttr>()) - GV->setName("\01" + ALA->getLabel()); - if (const SectionAttr *SA = D->getAttr<SectionAttr>()) GV->setSection(SA->getName()); @@ -629,12 +624,6 @@ void CodeGenModule::EmitGlobalDefinition(const ValueDecl *D) { if (D->getAttr<WeakAttr>() || D->getAttr<WeakImportAttr>()) GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage); - // FIXME: This should be handled by the mangler! - if (const AsmLabelAttr *ALA = D->getAttr<AsmLabelAttr>()) { - // 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<AsmLabelAttr>()) { - // 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); |