]> granicus.if.org Git - clang/commitdiff
Update for llvm API change.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 16 May 2014 13:34:28 +0000 (13:34 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 16 May 2014 13:34:28 +0000 (13:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208984 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGObjCGNU.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/ItaniumCXXABI.cpp
lib/CodeGen/TargetInfo.cpp

index f13bf26f5513a8b6cbff17e53128b0e4391563bf..08b74a3c30d2cf478be5cad8772669469e7e360a 100644 (file)
@@ -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) {
index 2689d7b459a922f37d55f4b824730fe7cb8769b7..a70f6335dfd9e76775548e49fe74b65333d72675 100644 (file)
@@ -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);
       }
index d9d2eb0fb56025361bd9afa11f10a057d2c09514..769b01c825e8341e1139afc7c2102541fdc40430 100644 (file)
@@ -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()));
   }
 }
 
index 07a8d8a846037a589d16ae95a30aed06b69b8186..4db51b26a07beb7378f7c357454665d9815f0f08 100644 (file)
@@ -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
index 5dc1a913fb407a3783301f575b3d1231b44e515f..0ed23ed371dd175af68bac9dc58caf133ed2baf0 100644 (file)
@@ -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());
     }
   }
 }