summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-08-09 05:09:04 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-08-09 05:09:04 +0000
commit94a76b64e066020aa819f821d972f90b8b1c4c6a (patch)
tree004b3fb4c8428ff2c2209d5829d8612f8e00d6cc /clang/lib/CodeGen/CodeGenModule.cpp
parent908606d0a9194b9097a081e548ce43e12617a4db (diff)
downloadbcm5719-llvm-94a76b64e066020aa819f821d972f90b8b1c4c6a.tar.gz
bcm5719-llvm-94a76b64e066020aa819f821d972f90b8b1c4c6a.zip
[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section
We mangled them like: L___uuid_12345678-1234-1234-1234-123456789abc We should've mangled them like: __GUID_12345678_1234_1234_1234_123456789abc Furthermore, they are external symbols. llvm-svn: 188053
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index dbdf016b31b..35c18b4c5eb 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1059,7 +1059,8 @@ llvm::Constant *CodeGenModule::GetAddrOfUuidDescriptor(
else
Uuid = "00000000-0000-0000-0000-000000000000";
}
- std::string Name = "__uuid_" + Uuid.str();
+ std::string Name = "_GUID_" + Uuid.lower();
+ std::replace(Name.begin(), Name.end(), '-', '_');
// Look for an existing global.
if (llvm::GlobalVariable *GV = getModule().getNamedGlobal(Name))
@@ -1082,7 +1083,7 @@ llvm::Constant *CodeGenModule::GetAddrOfUuidDescriptor(
}
llvm::GlobalVariable *GV = new llvm::GlobalVariable(getModule(), GuidType,
- /*isConstant=*/true, llvm::GlobalValue::PrivateLinkage, Init, Name);
+ /*isConstant=*/true, llvm::GlobalValue::ExternalLinkage, Init, Name);
GV->setUnnamedAddr(true);
return GV;
}
OpenPOWER on IntegriCloud