summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-21 16:52:05 +0000
committerChris Lattner <sabre@nondot.org>2003-11-21 16:52:05 +0000
commita29600046d469af2a18ce531ef86c1fc13606464 (patch)
tree17e38384e5907fe3ce4b013287de842e499bd5aa /llvm/lib/Transforms/Scalar
parentcc32e6e62a48ff0e11cdfce5bfeb9659521a05e1 (diff)
downloadbcm5719-llvm-a29600046d469af2a18ce531ef86c1fc13606464.tar.gz
bcm5719-llvm-a29600046d469af2a18ce531ef86c1fc13606464.zip
Minor cleanups and simplifications
llvm-svn: 10127
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/ADCE.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/LoopSimplify.cpp4
-rw-r--r--llvm/lib/Transforms/Scalar/LowerSwitch.cpp6
-rw-r--r--llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp2
4 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp
index 5a5151e8b64..4d7efd8ae4d 100644
--- a/llvm/lib/Transforms/Scalar/ADCE.cpp
+++ b/llvm/lib/Transforms/Scalar/ADCE.cpp
@@ -302,7 +302,7 @@ bool ADCE::doADCE() {
//
if (!AliveBlocks.count(&Func->front())) {
BasicBlock *NewEntry = new BasicBlock();
- new BranchInst(&Func->front(), 0, 0, NewEntry);
+ new BranchInst(&Func->front(), NewEntry);
Func->getBasicBlockList().push_front(NewEntry);
AliveBlocks.insert(NewEntry); // This block is always alive!
LiveSet.insert(NewEntry->getTerminator()); // The branch is live
diff --git a/llvm/lib/Transforms/Scalar/LoopSimplify.cpp b/llvm/lib/Transforms/Scalar/LoopSimplify.cpp
index 46f2beb34b0..60e35d5ca92 100644
--- a/llvm/lib/Transforms/Scalar/LoopSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopSimplify.cpp
@@ -153,7 +153,7 @@ BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB,
BasicBlock *NewBB = new BasicBlock(BB->getName()+Suffix, BB);
// The preheader first gets an unconditional branch to the loop header...
- BranchInst *BI = new BranchInst(BB, 0, 0, NewBB);
+ BranchInst *BI = new BranchInst(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
@@ -379,7 +379,7 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) {
// Create and insert the new backedge block...
BasicBlock *BEBlock = new BasicBlock(Header->getName()+".backedge", F);
- BranchInst *BETerminator = new BranchInst(Header, 0, 0, BEBlock);
+ BranchInst *BETerminator = new BranchInst(Header, BEBlock);
// Move the new backedge block to right after the last backedge block.
Function::iterator InsertPos = BackedgeBlocks.back(); ++InsertPos;
diff --git a/llvm/lib/Transforms/Scalar/LowerSwitch.cpp b/llvm/lib/Transforms/Scalar/LowerSwitch.cpp
index bec23fffc85..24e48d4c5d2 100644
--- a/llvm/lib/Transforms/Scalar/LowerSwitch.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerSwitch.cpp
@@ -186,7 +186,7 @@ void LowerSwitch::processSwitchInst(SwitchInst *SI) {
// If there is only the default destination, don't bother with the code below.
if (SI->getNumOperands() == 2) {
- new BranchInst(SI->getDefaultDest(), 0, 0, CurBlock);
+ new BranchInst(SI->getDefaultDest(), CurBlock);
delete SI;
return;
}
@@ -196,7 +196,7 @@ void LowerSwitch::processSwitchInst(SwitchInst *SI) {
BasicBlock* NewDefault = new BasicBlock("NewDefault");
F->getBasicBlockList().insert(Default, NewDefault);
- new BranchInst(Default, 0, 0, NewDefault);
+ new BranchInst(Default, NewDefault);
// If there is an entry in any PHI nodes for the default edge, make sure
// to update them as well.
@@ -219,7 +219,7 @@ void LowerSwitch::processSwitchInst(SwitchInst *SI) {
OrigBlock, NewDefault);
// Branch to our shiny new if-then stuff...
- new BranchInst(SwitchBlock, 0, 0, OrigBlock);
+ new BranchInst(SwitchBlock, OrigBlock);
// We are now done with the switch instruction, delete it.
delete SI;
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
index 87cd27d22be..f8215c57718 100644
--- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -76,7 +76,7 @@ bool TailCallElim::runOnFunction(Function &F) {
// us to branch back to the old entry block.
OldEntry = &F.getEntryBlock();
BasicBlock *NewEntry = new BasicBlock("tailrecurse", OldEntry);
- new BranchInst(OldEntry, 0, 0, NewEntry);
+ new BranchInst(OldEntry, NewEntry);
// Now that we have created a new block, which jumps to the entry
// block, insert a PHI node for each argument of the function.
OpenPOWER on IntegriCloud