diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/MicrosoftMangle.cpp | 5 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 45d60c620ef..8d7b76db5e9 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -317,7 +317,10 @@ void MicrosoftCXXNameMangler::mangleVariableEncoding(const VarDecl *VD) { // mangled as 'QAHA' instead of 'PAHB', for example. TypeLoc TL = VD->getTypeSourceInfo()->getTypeLoc(); QualType Ty = TL.getType(); - if (const ArrayType *AT = getASTContext().getAsArrayType(Ty)) { + if (Ty->isPointerType() || Ty->isReferenceType()) { + mangleType(Ty, TL.getSourceRange(), QMM_Drop); + mangleQualifiers(Ty->getPointeeType().getQualifiers(), false); + } else if (const ArrayType *AT = getASTContext().getAsArrayType(Ty)) { // Global arrays are funny, too. mangleDecayedArrayType(AT, true); if (AT->getElementType()->isArrayType()) diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 35c18b4c5eb..dbdf016b31b 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1059,8 +1059,7 @@ llvm::Constant *CodeGenModule::GetAddrOfUuidDescriptor( else Uuid = "00000000-0000-0000-0000-000000000000"; } - std::string Name = "_GUID_" + Uuid.lower(); - std::replace(Name.begin(), Name.end(), '-', '_'); + std::string Name = "__uuid_" + Uuid.str(); // Look for an existing global. if (llvm::GlobalVariable *GV = getModule().getNamedGlobal(Name)) @@ -1083,7 +1082,7 @@ llvm::Constant *CodeGenModule::GetAddrOfUuidDescriptor( } llvm::GlobalVariable *GV = new llvm::GlobalVariable(getModule(), GuidType, - /*isConstant=*/true, llvm::GlobalValue::ExternalLinkage, Init, Name); + /*isConstant=*/true, llvm::GlobalValue::PrivateLinkage, Init, Name); GV->setUnnamedAddr(true); return GV; } |