]> granicus.if.org Git - clang/commitdiff
Update for llvm api change.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 17 May 2014 21:30:14 +0000 (21:30 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 17 May 2014 21:30:14 +0000 (21:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209077 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 acd2089ec38ca71731c630a902d8641af630b7cb..571acf6ccb377ce6590d02423a6c1cabba9a0340 100644 (file)
@@ -175,8 +175,8 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl,
     return true;
 
   // Create the alias with no name.
-  auto *Alias = new llvm::GlobalAlias(AliasType->getElementType(), 0, Linkage,
-                                      "", Aliasee);
+  auto *Alias = llvm::GlobalAlias::create(AliasType->getElementType(), 0,
+                                          Linkage, "", Aliasee);
 
   // Switch any previous uses to the alias.
   if (Entry) {
index daedc5d264376cb8de8bc96f2cdce3c43e79520a..029d822afc9fc19ec8c0f08768d226fb10f74d72 100644 (file)
@@ -1053,7 +1053,7 @@ llvm::Value *CGObjCGNU::GetSelector(CodeGenFunction &CGF, Selector Sel,
     }
   }
   if (0 == SelValue) {
-    SelValue = new llvm::GlobalAlias(
+    SelValue = llvm::GlobalAlias::create(
         SelectorTy->getElementType(), 0, llvm::GlobalValue::PrivateLinkage,
         ".objc_selector_" + Sel.getAsString(), &TheModule);
     Types.push_back(TypedSelector(TypeEncoding, SelValue));
@@ -1257,14 +1257,14 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGenFunction &CGF,
     // super_class pointer from either the class or metaclass structure.
     if (IsClassMessage)  {
       if (!MetaClassPtrAlias) {
-        MetaClassPtrAlias = new llvm::GlobalAlias(
+        MetaClassPtrAlias = llvm::GlobalAlias::create(
             IdTy->getElementType(), 0, llvm::GlobalValue::InternalLinkage,
             ".objc_metaclass_ref" + Class->getNameAsString(), &TheModule);
       }
       ReceiverClass = MetaClassPtrAlias;
     } else {
       if (!ClassPtrAlias) {
-        ClassPtrAlias = new llvm::GlobalAlias(
+        ClassPtrAlias = llvm::GlobalAlias::create(
             IdTy->getElementType(), 0, llvm::GlobalValue::InternalLinkage,
             ".objc_class_ref" + Class->getNameAsString(), &TheModule);
       }
index 80f56e9bff3e37d52e9bf2d8c337fbbb8f49104f..485beab74034c354aa133b3c6fd0c9d0aa13f333 100644 (file)
@@ -2269,7 +2269,7 @@ 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(
+  auto *GA = llvm::GlobalAlias::create(
       cast<llvm::PointerType>(Aliasee->getType())->getElementType(), 0,
       llvm::Function::ExternalLinkage, "",
       &getGlobalObjectInExpr(Diags, AA, Aliasee));
@@ -3197,8 +3197,8 @@ void CodeGenModule::EmitStaticExternCAliases() {
     IdentifierInfo *Name = I->first;
     llvm::GlobalValue *Val = I->second;
     if (Val && !getModule().getNamedValue(Name->getName()))
-      addUsedGlobal(new llvm::GlobalAlias(Name->getName(),
-                                          cast<llvm::GlobalObject>(Val)));
+      addUsedGlobal(llvm::GlobalAlias::create(Name->getName(),
+                                              cast<llvm::GlobalObject>(Val)));
   }
 }
 
index 7ba5132b4b63198070b3983049413cac04c45e53..0df8cad5cce31ef5146e47bc6a458ddbe3035fff 100644 (file)
@@ -1627,8 +1627,8 @@ void ItaniumCXXABI::EmitThreadLocalInitFuncs(
     if (VD->hasDefinition()) {
       InitIsInitFunc = true;
       if (InitFunc)
-        Init = new llvm::GlobalAlias(Var->getLinkage(), InitFnName.str(),
-                                     InitFunc);
+        Init = llvm::GlobalAlias::create(Var->getLinkage(), InitFnName.str(),
+                                         InitFunc);
     } else {
       // Emit a weak global function referring to the initialization function.
       // This function will not exist if the TU defining the thread_local
index 9c2a6e9746c4870483661e046be2c5b71ff49535..a9cad6511f9e05ef91d9f5c9475e00fef1f0c8c2 100644 (file)
@@ -5211,8 +5211,8 @@ void MSP430TargetCodeGenInfo::SetTargetAttributes(const Decl *D,
 
       // Step 3: Emit ISR vector alias.
       unsigned Num = attr->getNumber() / 2;
-      new llvm::GlobalAlias(llvm::Function::ExternalLinkage,
-                            "__isr_" + Twine(Num), F);
+      llvm::GlobalAlias::create(llvm::Function::ExternalLinkage,
+                                "__isr_" + Twine(Num), F);
     }
   }
 }