summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGCXX.cpp4
-rw-r--r--clang/lib/CodeGen/CGObjCGNU.cpp6
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp11
-rw-r--r--clang/lib/CodeGen/ItaniumCXXABI.cpp6
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp6
5 files changed, 17 insertions, 16 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp
index f13bf26f551..08b74a3c30d 100644
--- a/clang/lib/CodeGen/CGCXX.cpp
+++ b/clang/lib/CodeGen/CGCXX.cpp
@@ -172,8 +172,8 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl,
return true;
// Create the alias with no name.
- llvm::GlobalAlias *Alias =
- new llvm::GlobalAlias(AliasType, Linkage, "", Aliasee, &getModule());
+ auto *Alias = new llvm::GlobalAlias(
+ AliasType->getElementType(), Linkage, "", Aliasee, &getModule());
// Switch any previous uses to the alias.
if (Entry) {
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index 2689d7b459a..a70f6335dfd 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -1053,7 +1053,7 @@ llvm::Value *CGObjCGNU::GetSelector(CodeGenFunction &CGF, Selector Sel,
}
}
if (0 == SelValue) {
- SelValue = new llvm::GlobalAlias(SelectorTy,
+ SelValue = new llvm::GlobalAlias(SelectorTy->getElementType(),
llvm::GlobalValue::PrivateLinkage,
".objc_selector_"+Sel.getAsString(), NULL,
&TheModule);
@@ -1258,14 +1258,14 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGenFunction &CGF,
// super_class pointer from either the class or metaclass structure.
if (IsClassMessage) {
if (!MetaClassPtrAlias) {
- MetaClassPtrAlias = new llvm::GlobalAlias(IdTy,
+ MetaClassPtrAlias = new llvm::GlobalAlias(IdTy->getElementType(),
llvm::GlobalValue::InternalLinkage, ".objc_metaclass_ref" +
Class->getNameAsString(), NULL, &TheModule);
}
ReceiverClass = MetaClassPtrAlias;
} else {
if (!ClassPtrAlias) {
- ClassPtrAlias = new llvm::GlobalAlias(IdTy,
+ ClassPtrAlias = new llvm::GlobalAlias(IdTy->getElementType(),
llvm::GlobalValue::InternalLinkage, ".objc_class_ref" +
Class->getNameAsString(), NULL, &TheModule);
}
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()));
}
}
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 07a8d8a8460..4db51b26a07 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -1627,9 +1627,9 @@ void ItaniumCXXABI::EmitThreadLocalInitFuncs(
if (VD->hasDefinition()) {
InitIsInitFunc = true;
if (InitFunc)
- Init =
- new llvm::GlobalAlias(InitFunc->getType(), Var->getLinkage(),
- InitFnName.str(), InitFunc, &CGM.getModule());
+ Init = new llvm::GlobalAlias(InitFunc->getType()->getElementType(),
+ Var->getLinkage(), InitFnName.str(),
+ InitFunc, &CGM.getModule());
} else {
// Emit a weak global function referring to the initialization function.
// This function will not exist if the TU defining the thread_local
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 5dc1a913fb4..0ed23ed371d 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -5211,9 +5211,9 @@ void MSP430TargetCodeGenInfo::SetTargetAttributes(const Decl *D,
// Step 3: Emit ISR vector alias.
unsigned Num = attr->getNumber() / 2;
- new llvm::GlobalAlias(GV->getType(), llvm::Function::ExternalLinkage,
- "__isr_" + Twine(Num),
- GV, &M.getModule());
+ new llvm::GlobalAlias(GV->getType()->getElementType(),
+ llvm::Function::ExternalLinkage,
+ "__isr_" + Twine(Num), GV, &M.getModule());
}
}
}
OpenPOWER on IntegriCloud