X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FUnreachableBlockElim.cpp;h=d393e103104df5c29fcbf601a41bb71129f3b57a;hb=f606a6ed992d5e4e2877419b51e2a9b540b5e3f0;hp=2e220820b9211d8c815a08f9663bd5dc3b0889bd;hpb=9f998de8918c1dd5a8b8ec564af00107859898e0;p=oota-llvm.git diff --git a/lib/CodeGen/UnreachableBlockElim.cpp b/lib/CodeGen/UnreachableBlockElim.cpp index 2e220820b92..d393e103104 100644 --- a/lib/CodeGen/UnreachableBlockElim.cpp +++ b/lib/CodeGen/UnreachableBlockElim.cpp @@ -64,9 +64,8 @@ bool UnreachableBlockElim::runOnFunction(Function &F) { SmallPtrSet Reachable; // Mark all reachable blocks. - for (df_ext_iterator > I = - df_ext_begin(&F, Reachable), E = df_ext_end(&F, Reachable); I != E; ++I) - /* Mark all reachable blocks */; + for (BasicBlock *BB : depth_first_ext(&F, Reachable)) + (void)BB/* Mark all reachable blocks */; // Loop over all dead blocks, remembering them and deleting all instructions // in them. @@ -89,7 +88,7 @@ bool UnreachableBlockElim::runOnFunction(Function &F) { DeadBlocks[i]->eraseFromParent(); } - return DeadBlocks.size(); + return !DeadBlocks.empty(); } @@ -125,10 +124,8 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) { MachineLoopInfo *MLI = getAnalysisIfAvailable(); // Mark all reachable blocks. - for (df_ext_iterator > - I = df_ext_begin(&F, Reachable), E = df_ext_end(&F, Reachable); - I != E; ++I) - /* Mark all reachable blocks */; + for (MachineBasicBlock *BB : depth_first_ext(&F, Reachable)) + (void)BB/* Mark all reachable blocks */; // Loop over all dead blocks, remembering them and deleting all instructions // in them. @@ -207,5 +204,5 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) { F.RenumberBlocks(); - return (DeadBlocks.size() || ModifiedPHI); + return (!DeadBlocks.empty() || ModifiedPHI); }