diff options
Diffstat (limited to 'docs/tutorial/LangImpl5.html')
-rw-r--r-- | docs/tutorial/LangImpl5.html | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/docs/tutorial/LangImpl5.html b/docs/tutorial/LangImpl5.html index ae53fd9f99..1ff4e65b4f 100644 --- a/docs/tutorial/LangImpl5.html +++ b/docs/tutorial/LangImpl5.html @@ -379,9 +379,9 @@ value as a 1-bit (bool) value.</p> // Create blocks for the then and else cases. Insert the 'then' block at the // end of the function. - BasicBlock *ThenBB = new BasicBlock("then", TheFunction); - BasicBlock *ElseBB = new BasicBlock("else"); - BasicBlock *MergeBB = new BasicBlock("ifcont"); + BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction); + BasicBlock *ElseBB = BasicBlock::Create("else"); + BasicBlock *MergeBB = BasicBlock::Create("ifcont"); Builder.CreateCondBr(CondV, ThenBB, ElseBB); </pre> @@ -727,7 +727,7 @@ block, but remember that the body code itself could consist of multiple blocks // block. Function *TheFunction = Builder.GetInsertBlock()->getParent(); BasicBlock *PreheaderBB = Builder.GetInsertBlock(); - BasicBlock *LoopBB = new BasicBlock("loop", TheFunction); + BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction); // Insert an explicit fall through from the current block to the LoopBB. Builder.CreateBr(LoopBB); @@ -828,7 +828,7 @@ statement.</p> <pre> // Create the "after loop" block and insert it. BasicBlock *LoopEndBB = Builder.GetInsertBlock(); - BasicBlock *AfterBB = new BasicBlock("afterloop", TheFunction); + BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction); // Insert the conditional branch into the end of LoopEndBB. Builder.CreateCondBr(EndCond, LoopBB, AfterBB); @@ -1417,9 +1417,9 @@ Value *IfExprAST::Codegen() { // Create blocks for the then and else cases. Insert the 'then' block at the // end of the function. - BasicBlock *ThenBB = new BasicBlock("then", TheFunction); - BasicBlock *ElseBB = new BasicBlock("else"); - BasicBlock *MergeBB = new BasicBlock("ifcont"); + BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction); + BasicBlock *ElseBB = BasicBlock::Create("else"); + BasicBlock *MergeBB = BasicBlock::Create("ifcont"); Builder.CreateCondBr(CondV, ThenBB, ElseBB); @@ -1479,7 +1479,7 @@ Value *ForExprAST::Codegen() { // block. Function *TheFunction = Builder.GetInsertBlock()->getParent(); BasicBlock *PreheaderBB = Builder.GetInsertBlock(); - BasicBlock *LoopBB = new BasicBlock("loop", TheFunction); + BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction); // Insert an explicit fall through from the current block to the LoopBB. Builder.CreateBr(LoopBB); @@ -1525,7 +1525,7 @@ Value *ForExprAST::Codegen() { // Create the "after loop" block and insert it. BasicBlock *LoopEndBB = Builder.GetInsertBlock(); - BasicBlock *AfterBB = new BasicBlock("afterloop", TheFunction); + BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction); // Insert the conditional branch into the end of LoopEndBB. Builder.CreateCondBr(EndCond, LoopBB, AfterBB); @@ -1552,7 +1552,7 @@ Function *PrototypeAST::Codegen() { std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy); FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false); - Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule); + Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule); // If F conflicted, there was already something named 'Name'. If it has a // body, don't allow redefinition or reextern. @@ -1595,7 +1595,7 @@ Function *FunctionAST::Codegen() { return 0; // Create a new basic block to start insertion into. - BasicBlock *BB = new BasicBlock("entry", TheFunction); + BasicBlock *BB = BasicBlock::Create("entry", TheFunction); Builder.SetInsertPoint(BB); if (Value *RetVal = Body->Codegen()) { |