[cfe-commits] r49279 - in /cfe/trunk/lib/CodeGen: CGExprAgg.cpp CGExprComplex.cpp CGExprScalar.cpp CGObjCEtoile.cpp CGObjCGNU.cpp CGStmt.cpp CodeGenFunction.cpp CodeGenModule.cpp

Gabor Greif ggreif at gmail.com
Sun Apr 6 13:42:52 PDT 2008


Author: ggreif
Date: Sun Apr  6 15:42:52 2008
New Revision: 49279

URL: http://llvm.org/viewvc/llvm-project?rev=49279&view=rev
Log:
tracking API changes arising from r49277

Modified:
    cfe/trunk/lib/CodeGen/CGExprAgg.cpp
    cfe/trunk/lib/CodeGen/CGExprComplex.cpp
    cfe/trunk/lib/CodeGen/CGExprScalar.cpp
    cfe/trunk/lib/CodeGen/CGObjCEtoile.cpp
    cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
    cfe/trunk/lib/CodeGen/CGStmt.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=49279&r1=49278&r2=49279&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Sun Apr  6 15:42:52 2008
@@ -238,9 +238,9 @@
 }
 
 void AggExprEmitter::VisitConditionalOperator(const ConditionalOperator *E) {
-  llvm::BasicBlock *LHSBlock = new llvm::BasicBlock("cond.?");
-  llvm::BasicBlock *RHSBlock = new llvm::BasicBlock("cond.:");
-  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("cond.cont");
+  llvm::BasicBlock *LHSBlock = llvm::BasicBlock::Create("cond.?");
+  llvm::BasicBlock *RHSBlock = llvm::BasicBlock::Create("cond.:");
+  llvm::BasicBlock *ContBlock = llvm::BasicBlock::Create("cond.cont");
   
   llvm::Value *Cond = CGF.EvaluateExprAsBool(E->getCond());
   Builder.CreateCondBr(Cond, LHSBlock, RHSBlock);

Modified: cfe/trunk/lib/CodeGen/CGExprComplex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprComplex.cpp?rev=49279&r1=49278&r2=49279&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprComplex.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprComplex.cpp Sun Apr  6 15:42:52 2008
@@ -455,9 +455,9 @@
 
 ComplexPairTy ComplexExprEmitter::
 VisitConditionalOperator(const ConditionalOperator *E) {
-  llvm::BasicBlock *LHSBlock = new llvm::BasicBlock("cond.?");
-  llvm::BasicBlock *RHSBlock = new llvm::BasicBlock("cond.:");
-  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("cond.cont");
+  llvm::BasicBlock *LHSBlock = llvm::BasicBlock::Create("cond.?");
+  llvm::BasicBlock *RHSBlock = llvm::BasicBlock::Create("cond.:");
+  llvm::BasicBlock *ContBlock = llvm::BasicBlock::Create("cond.cont");
   
   llvm::Value *Cond = CGF.EvaluateExprAsBool(E->getCond());
   Builder.CreateCondBr(Cond, LHSBlock, RHSBlock);

Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=49279&r1=49278&r2=49279&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Sun Apr  6 15:42:52 2008
@@ -960,8 +960,8 @@
 Value *ScalarExprEmitter::VisitBinLAnd(const BinaryOperator *E) {
   Value *LHSCond = CGF.EvaluateExprAsBool(E->getLHS());
   
-  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("land_cont");
-  llvm::BasicBlock *RHSBlock = new llvm::BasicBlock("land_rhs");
+  llvm::BasicBlock *ContBlock = llvm::BasicBlock::Create("land_cont");
+  llvm::BasicBlock *RHSBlock = llvm::BasicBlock::Create("land_rhs");
   
   llvm::BasicBlock *OrigBlock = Builder.GetInsertBlock();
   Builder.CreateCondBr(LHSCond, RHSBlock, ContBlock);
@@ -987,8 +987,8 @@
 Value *ScalarExprEmitter::VisitBinLOr(const BinaryOperator *E) {
   Value *LHSCond = CGF.EvaluateExprAsBool(E->getLHS());
   
-  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("lor_cont");
-  llvm::BasicBlock *RHSBlock = new llvm::BasicBlock("lor_rhs");
+  llvm::BasicBlock *ContBlock = llvm::BasicBlock::Create("lor_cont");
+  llvm::BasicBlock *RHSBlock = llvm::BasicBlock::Create("lor_rhs");
   
   llvm::BasicBlock *OrigBlock = Builder.GetInsertBlock();
   Builder.CreateCondBr(LHSCond, ContBlock, RHSBlock);
@@ -1022,9 +1022,9 @@
 
 Value *ScalarExprEmitter::
 VisitConditionalOperator(const ConditionalOperator *E) {
-  llvm::BasicBlock *LHSBlock = new llvm::BasicBlock("cond.?");
-  llvm::BasicBlock *RHSBlock = new llvm::BasicBlock("cond.:");
-  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("cond.cont");
+  llvm::BasicBlock *LHSBlock = llvm::BasicBlock::Create("cond.?");
+  llvm::BasicBlock *RHSBlock = llvm::BasicBlock::Create("cond.:");
+  llvm::BasicBlock *ContBlock = llvm::BasicBlock::Create("cond.cont");
   
   // Evaluate the conditional, then convert it to bool.  We do this explicitly
   // because we need the unconverted value if this is a GNU ?: expression with

Modified: cfe/trunk/lib/CodeGen/CGObjCEtoile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCEtoile.cpp?rev=49279&r1=49278&r2=49279&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCEtoile.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCEtoile.cpp Sun Apr  6 15:42:52 2008
@@ -231,7 +231,7 @@
   }
   llvm::FunctionType *MethodTy = 
     llvm::FunctionType::get(ReturnTy, Args, isVarArg);
-  llvm::Function *Method = new llvm::Function(MethodTy,
+  llvm::Function *Method = llvm::Function::Create(MethodTy,
       llvm::GlobalValue::InternalLinkage,
       ".objc.method",
       &TheModule);

Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=49279&r1=49278&r2=49279&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Sun Apr  6 15:42:52 2008
@@ -170,7 +170,7 @@
   llvm::FunctionType *MethodTy = llvm::FunctionType::get(ReturnTy,
       Args,
       isVarArg);
-  llvm::Function *Method = new llvm::Function(MethodTy,
+  llvm::Function *Method = llvm::Function::Create(MethodTy,
       llvm::GlobalValue::InternalLinkage,
       ".objc.method",
       &TheModule);

Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=49279&r1=49278&r2=49279&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Sun Apr  6 15:42:52 2008
@@ -116,7 +116,7 @@
   
   // Emit a block after the branch so that dead code after a goto has some place
   // to go.
-  Builder.SetInsertPoint(new llvm::BasicBlock("", CurFn));
+  Builder.SetInsertPoint(llvm::BasicBlock::Create("", CurFn));
 }
 
 void CodeGenFunction::EmitIfStmt(const IfStmt &S) {
@@ -124,12 +124,12 @@
   // unequal to 0.  The condition must be a scalar type.
   llvm::Value *BoolCondVal = EvaluateExprAsBool(S.getCond());
   
-  llvm::BasicBlock *ContBlock = new llvm::BasicBlock("ifend");
-  llvm::BasicBlock *ThenBlock = new llvm::BasicBlock("ifthen");
+  llvm::BasicBlock *ContBlock = llvm::BasicBlock::Create("ifend");
+  llvm::BasicBlock *ThenBlock = llvm::BasicBlock::Create("ifthen");
   llvm::BasicBlock *ElseBlock = ContBlock;
   
   if (S.getElse())
-    ElseBlock = new llvm::BasicBlock("ifelse");
+    ElseBlock = llvm::BasicBlock::Create("ifelse");
   
   // Insert the conditional branch.
   Builder.CreateCondBr(BoolCondVal, ThenBlock, ElseBlock);
@@ -165,7 +165,7 @@
 void CodeGenFunction::EmitWhileStmt(const WhileStmt &S) {
   // Emit the header for the loop, insert it, which will create an uncond br to
   // it.
-  llvm::BasicBlock *LoopHeader = new llvm::BasicBlock("whilecond");
+  llvm::BasicBlock *LoopHeader = llvm::BasicBlock::Create("whilecond");
   EmitBlock(LoopHeader);
   
   // Evaluate the conditional in the while header.  C99 6.8.5.1: The evaluation
@@ -182,8 +182,8 @@
   
   // Create an exit block for when the condition fails, create a block for the
   // body of the loop.
-  llvm::BasicBlock *ExitBlock = new llvm::BasicBlock("whileexit");
-  llvm::BasicBlock *LoopBody  = new llvm::BasicBlock("whilebody");
+  llvm::BasicBlock *ExitBlock = llvm::BasicBlock::Create("whileexit");
+  llvm::BasicBlock *LoopBody  = llvm::BasicBlock::Create("whilebody");
   
   // As long as the condition is true, go to the loop body.
   if (EmitBoolCondBranch)
@@ -216,11 +216,11 @@
 void CodeGenFunction::EmitDoStmt(const DoStmt &S) {
   // Emit the body for the loop, insert it, which will create an uncond br to
   // it.
-  llvm::BasicBlock *LoopBody = new llvm::BasicBlock("dobody");
-  llvm::BasicBlock *AfterDo = new llvm::BasicBlock("afterdo");
+  llvm::BasicBlock *LoopBody = llvm::BasicBlock::Create("dobody");
+  llvm::BasicBlock *AfterDo = llvm::BasicBlock::Create("afterdo");
   EmitBlock(LoopBody);
 
-  llvm::BasicBlock *DoCond = new llvm::BasicBlock("docond");
+  llvm::BasicBlock *DoCond = llvm::BasicBlock::Create("docond");
   
   // Store the blocks to use for break and continue.
   BreakContinueStack.push_back(BreakContinue(AfterDo, DoCond));
@@ -274,8 +274,8 @@
     EmitStmt(S.getInit());
 
   // Start the loop with a block that tests the condition.
-  llvm::BasicBlock *CondBlock = new llvm::BasicBlock("forcond");
-  llvm::BasicBlock *AfterFor = new llvm::BasicBlock("afterfor");
+  llvm::BasicBlock *CondBlock = llvm::BasicBlock::Create("forcond");
+  llvm::BasicBlock *AfterFor = llvm::BasicBlock::Create("afterfor");
 
   EmitBlock(CondBlock);
 
@@ -287,7 +287,7 @@
     llvm::Value *BoolCondVal = EvaluateExprAsBool(S.getCond());
     
     // As long as the condition is true, iterate the loop.
-    llvm::BasicBlock *ForBody = new llvm::BasicBlock("forbody");
+    llvm::BasicBlock *ForBody = llvm::BasicBlock::Create("forbody");
     Builder.CreateCondBr(BoolCondVal, ForBody, AfterFor);
     EmitBlock(ForBody);    
   } else {
@@ -299,7 +299,7 @@
   // condition as the continue block.
   llvm::BasicBlock *ContinueBlock;
   if (S.getInc())
-    ContinueBlock = new llvm::BasicBlock("forinc");
+    ContinueBlock = llvm::BasicBlock::Create("forinc");
   else
     ContinueBlock = CondBlock;  
   
@@ -354,7 +354,7 @@
   
   // Emit a block after the branch so that dead code after a return has some
   // place to go.
-  EmitBlock(new llvm::BasicBlock());
+  EmitBlock(llvm::BasicBlock::Create());
 }
 
 void CodeGenFunction::EmitDeclStmt(const DeclStmt &S) {
@@ -368,7 +368,7 @@
 
   llvm::BasicBlock *Block = BreakContinueStack.back().BreakBlock;
   Builder.CreateBr(Block);
-  EmitBlock(new llvm::BasicBlock());
+  EmitBlock(llvm::BasicBlock::Create());
 }
 
 void CodeGenFunction::EmitContinueStmt() {
@@ -376,7 +376,7 @@
 
   llvm::BasicBlock *Block = BreakContinueStack.back().ContinueBlock;
   Builder.CreateBr(Block);
-  EmitBlock(new llvm::BasicBlock());
+  EmitBlock(llvm::BasicBlock::Create());
 }
 
 /// EmitCaseStmtRange - If case statement range is not too big then
@@ -410,7 +410,7 @@
     
   // The range is too big. Emit "if" condition.
   llvm::BasicBlock *FalseDest = NULL;
-  llvm::BasicBlock *CaseDest = new llvm::BasicBlock("sw.bb");
+  llvm::BasicBlock *CaseDest = llvm::BasicBlock::Create("sw.bb");
 
   // If we have already seen one case statement range for this switch
   // instruction then piggy-back otherwise use default block as false
@@ -468,7 +468,7 @@
 
   // Create basic block to hold stuff that comes after switch statement.
   // Initially use it to hold DefaultStmt.
-  llvm::BasicBlock *NextBlock = new llvm::BasicBlock("after.sw");
+  llvm::BasicBlock *NextBlock = llvm::BasicBlock::Create("after.sw");
   SwitchInsn = Builder.CreateSwitch(CondV, NextBlock);
 
   // All break statements jump to NextBlock. If BreakContinueStack is non empty

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=49279&r1=49278&r2=49279&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Sun Apr  6 15:42:52 2008
@@ -38,7 +38,7 @@
   if (BB) return BB;
   
   // Create, but don't insert, the new block.
-  return BB = new llvm::BasicBlock(S->getName());
+  return BB = llvm::BasicBlock::Create(S->getName());
 }
 
 llvm::Constant *
@@ -69,7 +69,7 @@
                                               ParamTypes.begin(),
                                               OMD->param_size(),
                                               OMD->isVariadic());
-  llvm::BasicBlock *EntryBB = new llvm::BasicBlock("entry", CurFn);
+  llvm::BasicBlock *EntryBB = llvm::BasicBlock::Create("entry", CurFn);
   
   // Create a marker to make it easy to insert allocas into the entryblock
   // later.  Don't create this with the builder, because we don't want it
@@ -188,7 +188,7 @@
     CurFn->setParamAttrs(llvm::PAListPtr::get(&PAWI, 1));
   }
 
-  llvm::BasicBlock *EntryBB = new llvm::BasicBlock("entry", CurFn);
+  llvm::BasicBlock *EntryBB = llvm::BasicBlock::Create("entry", CurFn);
   
   // Create a marker to make it easy to insert allocas into the entryblock
   // later.  Don't create this with the builder, because we don't want it
@@ -252,7 +252,7 @@
 void CodeGenFunction::StartBlock(const char *N) {
   llvm::BasicBlock *BB = Builder.GetInsertBlock();
   if (!isDummyBlock(BB))
-    EmitBlock(new llvm::BasicBlock(N));
+    EmitBlock(llvm::BasicBlock::Create(N));
   else
     BB->setName(N);
 }

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=49279&r1=49278&r2=49279&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sun Apr  6 15:42:52 2008
@@ -149,7 +149,7 @@
   // If it doesn't already exist, just create and return an entry.
   if (F == 0) {
     // FIXME: param attributes for sext/zext etc.
-    F = new llvm::Function(FTy, llvm::Function::ExternalLinkage, D->getName(),
+    F = llvm::Function::Create(FTy, llvm::Function::ExternalLinkage, D->getName(),
                            &getModule());
 
     // Set the appropriate calling convention for the Function.
@@ -174,7 +174,7 @@
   // This happens if there is a prototype for a function (e.g. "int f()") and
   // then a definition of a different type (e.g. "int f(int x)").  Start by
   // making a new function of the correct type, RAUW, then steal the name.
-  llvm::Function *NewFn = new llvm::Function(FTy, 
+  llvm::Function *NewFn = llvm::Function::Create(FTy, 
                                              llvm::Function::ExternalLinkage,
                                              "", &getModule());
   NewFn->takeName(F);
@@ -399,7 +399,7 @@
   }
 
   // FIXME: param attributes for sext/zext etc.
-  return FunctionSlot = new llvm::Function(Ty, llvm::Function::ExternalLinkage,
+  return FunctionSlot = llvm::Function::Create(Ty, llvm::Function::ExternalLinkage,
                                            Name, &getModule());
 }
 





More information about the cfe-commits mailing list