diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 558c940713a..33aff2553fd 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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. |