diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-02 03:41:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-02 03:41:24 +0000 |
commit | b00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace (patch) | |
tree | 44b5f879c16e7ecb2e9334ad120e3454270e1bb3 /lib/Transforms/Scalar/DCE.cpp | |
parent | 1d87bcf4909b06dcd86320722653341f08b8b396 (diff) | |
download | external_llvm-b00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace.zip external_llvm-b00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace.tar.gz external_llvm-b00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace.tar.bz2 |
Commit more code over to new cast style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/DCE.cpp')
-rw-r--r-- | lib/Transforms/Scalar/DCE.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp index ba3db99..10dcf1e 100644 --- a/lib/Transforms/Scalar/DCE.cpp +++ b/lib/Transforms/Scalar/DCE.cpp @@ -84,7 +84,7 @@ static bool RemoveSingularPHIs(BasicBlock *BB) { return false; // More than one predecessor... Instruction *I = BB->front(); - if (!I->isPHINode()) return false; // No PHI nodes + if (!isa<PHINode>(I)) return false; // No PHI nodes //cerr << "Killing PHIs from " << BB; //cerr << "Pred #0 = " << *BB->pred_begin(); @@ -92,7 +92,7 @@ static bool RemoveSingularPHIs(BasicBlock *BB) { //cerr << "Method == " << BB->getParent(); do { - PHINode *PN = (PHINode*)I; + PHINode *PN = cast<PHINode>(I); assert(PN->getNumOperands() == 2 && "PHI node should only have one value!"); Value *V = PN->getOperand(0); @@ -100,7 +100,7 @@ static bool RemoveSingularPHIs(BasicBlock *BB) { delete BB->getInstList().remove(BB->begin()); I = BB->front(); - } while (I->isPHINode()); + } while (isa<PHINode>(I)); return true; // Yes, we nuked at least one phi node } @@ -120,7 +120,7 @@ static void ReplaceUsesWithConstant(Instruction *I) { // Assumption: BB is the single predecessor of Succ. // static void PropogatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) { - assert(Succ->front()->isPHINode() && "Only works on PHId BBs!"); + assert(isa<PHINode>(Succ->front()) && "Only works on PHId BBs!"); // If there is more than one predecessor, and there are PHI nodes in // the successor, then we need to add incoming edges for the PHI nodes @@ -129,7 +129,7 @@ static void PropogatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) { BasicBlock::iterator I = Succ->begin(); do { // Loop over all of the PHI nodes in the successor BB - PHINode *PN = (PHINode*)*I; + PHINode *PN = cast<PHINode>(*I); Value *OldVal = PN->removeIncomingValue(BB); assert(OldVal && "No entry in PHI for Pred BB!"); @@ -140,7 +140,7 @@ static void PropogatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) { } ++I; - } while ((*I)->isPHINode()); + } while (isa<PHINode>(*I)); } @@ -198,7 +198,7 @@ bool opt::SimplifyCFG(Method::iterator &BBIt) { //cerr << "Killing Trivial BB: \n" << BB; if (Succ != BB) { // Arg, don't hurt infinite loops! - if (Succ->front()->isPHINode()) { + if (isa<PHINode>(Succ->front())) { // If our successor has PHI nodes, then we need to update them to // include entries for BB's predecessors, not for BB itself. // |