summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d9d2eb0fb56..769b01c825e 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -2274,9 +2274,9 @@ void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) {
llvm::PointerType::getUnqual(DeclTy), 0);
// Create the new alias itself, but don't set a name yet.
- auto *GA =
- new llvm::GlobalAlias(Aliasee->getType(), llvm::Function::ExternalLinkage,
- "", Aliasee, &getModule());
+ auto *GA = new llvm::GlobalAlias(
+ cast<llvm::PointerType>(Aliasee->getType())->getElementType(),
+ llvm::Function::ExternalLinkage, "", Aliasee, &getModule());
if (Entry) {
assert(Entry->isDeclaration());
@@ -3196,8 +3196,9 @@ void CodeGenModule::EmitStaticExternCAliases() {
IdentifierInfo *Name = I->first;
llvm::GlobalValue *Val = I->second;
if (Val && !getModule().getNamedValue(Name->getName()))
- addUsedGlobal(new llvm::GlobalAlias(Val->getType(), Val->getLinkage(),
- Name->getName(), Val, &getModule()));
+ addUsedGlobal(new llvm::GlobalAlias(Val->getType()->getElementType(),
+ Val->getLinkage(), Name->getName(),
+ Val, &getModule()));
}
}
OpenPOWER on IntegriCloud