From c24a076c6a22a932e4fc2b745fd748fe7ee3cb15 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 4 Feb 2004 03:58:28 +0000 Subject: [PATCH] Adjust to the new BasicBlock ctor, which requires a function parameter git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11114 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/TailRecursionElimination.cpp | 2 +- lib/Transforms/Utils/LoopSimplify.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/TailRecursionElimination.cpp b/lib/Transforms/Scalar/TailRecursionElimination.cpp index 69fb7ad4aa9..0ca5562bae9 100644 --- a/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -290,7 +290,7 @@ bool TailCallElim::ProcessReturningBlock(ReturnInst *Ret, BasicBlock *&OldEntry, if (OldEntry == 0) { OldEntry = &F->getEntryBlock(); std::string OldName = OldEntry->getName(); OldEntry->setName("tailrecurse"); - BasicBlock *NewEntry = new BasicBlock(OldName, OldEntry); + BasicBlock *NewEntry = new BasicBlock(OldName, F, OldEntry); new BranchInst(OldEntry, NewEntry); // Now that we have created a new block, which jumps to the entry diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 45f31aa4a89..f27a0cf60a6 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -151,7 +151,7 @@ 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); + BasicBlock *NewBB = new BasicBlock(BB->getName()+Suffix, BB->getParent(), BB); // The preheader first gets an unconditional branch to the loop header... BranchInst *BI = new BranchInst(BB, NewBB); -- 2.34.1