From: Rafael Espindola Date: Fri, 16 May 2014 13:34:28 +0000 (+0000) Subject: Update for llvm API change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01920cff95cdb9806c176ae7b2830c379ac505d2;p=clang Update for llvm API change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208984 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index f13bf26f55..08b74a3c30 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/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/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 2689d7b459..a70f6335df 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/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/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index d9d2eb0fb5..769b01c825 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/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(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/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp index 07a8d8a846..4db51b26a0 100644 --- a/lib/CodeGen/ItaniumCXXABI.cpp +++ b/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/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 5dc1a913fb..0ed23ed371 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/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()); } } }