From 5b9e9682f186ce772de8beb160fc912b60ae5148 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 4 Mar 2009 17:31:19 +0000 Subject: Support "asm" renaming of external symbols. - PR3698. llvm-svn: 66038 --- clang/lib/CodeGen/CodeGenModule.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 558c940713aa..33aff2553fd0 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()) GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage); + + 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()); + } } // Make sure the result is of the correct type. -- cgit v1.2.3