X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTransforms%2FUtils%2FLoopSimplify.cpp;h=e6f5e7c39cd329e24035bfd474ac8650e44d3c85;hb=051a950000e21935165db56695e35bade668193b;hp=16cb30ca9c219fd5f5d2b32399c98aa8943d4313;hpb=d963ab1f58adb6daa028533ff3285841d7e45f80;p=oota-llvm.git diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 16cb30ca9c2..e6f5e7c39cd 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -270,10 +270,10 @@ BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB, const std::vector &Preds) { // Create new basic block, insert right before the original block... - BasicBlock *NewBB = new BasicBlock(BB->getName()+Suffix, BB->getParent(), BB); + BasicBlock *NewBB = BasicBlock::Create(BB->getName()+Suffix, BB->getParent(), BB); // The preheader first gets an unconditional branch to the loop header... - BranchInst *BI = new BranchInst(BB, NewBB); + BranchInst *BI = BranchInst::Create(BB, NewBB); // For every PHI node in the block, insert a PHI node into NewBB where the // incoming values from the out of loop edges are moved to NewBB. We have two @@ -300,7 +300,7 @@ BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB, // If the values coming into the block are not the same, we need a PHI. if (InVal == 0) { // Create the new PHI node, insert it into NewBB at the end of the block - PHINode *NewPHI = new PHINode(PN->getType(), PN->getName()+".ph", BI); + PHINode *NewPHI = PHINode::Create(PN->getType(), PN->getName()+".ph", BI); if (AA) AA->copyValue(PN, NewPHI); // Move all of the edges from blocks outside the loop to the new PHI @@ -623,8 +623,8 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) { if (*I != Preheader) BackedgeBlocks.push_back(*I); // Create and insert the new backedge block... - BasicBlock *BEBlock = new BasicBlock(Header->getName()+".backedge", F); - BranchInst *BETerminator = new BranchInst(Header, BEBlock); + BasicBlock *BEBlock = BasicBlock::Create(Header->getName()+".backedge", F); + BranchInst *BETerminator = BranchInst::Create(Header, BEBlock); // Move the new backedge block to right after the last backedge block. Function::iterator InsertPos = BackedgeBlocks.back(); ++InsertPos; @@ -634,8 +634,8 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) { // the backedge block which correspond to any PHI nodes in the header block. for (BasicBlock::iterator I = Header->begin(); isa(I); ++I) { PHINode *PN = cast(I); - PHINode *NewPN = new PHINode(PN->getType(), PN->getName()+".be", - BETerminator); + PHINode *NewPN = PHINode::Create(PN->getType(), PN->getName()+".be", + BETerminator); NewPN->reserveOperandSpace(BackedgeBlocks.size()); if (AA) AA->copyValue(PN, NewPN);