diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-04 17:31:19 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-04 17:31:19 +0000 |
commit | 3f75c43bd77e063342bc888ac276daf64ba0ce07 (patch) | |
tree | a3220463755fae438e55ad433fbd42896c938adb /lib/CodeGen | |
parent | 6ac1e2252b1a16fd8841c4b1af8fe41b820aa41d (diff) |
Support "asm" renaming of external symbols.
- PR3698.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66038 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 558c940713..33aff2553f 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -605,6 +605,12 @@ void CodeGenModule::EmitGlobalDefinition(const ValueDecl *D) { if (D->getAttr<WeakAttr>()) GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage); + + 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()); + } } // Make sure the result is of the correct type. |