diff options
Diffstat (limited to 'lib/CodeGen/UnreachableBlockElim.cpp')
-rw-r--r-- | lib/CodeGen/UnreachableBlockElim.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/CodeGen/UnreachableBlockElim.cpp b/lib/CodeGen/UnreachableBlockElim.cpp index 152f2f84e8..7bf95bf96e 100644 --- a/lib/CodeGen/UnreachableBlockElim.cpp +++ b/lib/CodeGen/UnreachableBlockElim.cpp @@ -32,6 +32,7 @@ #include "llvm/Support/Compiler.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/ADT/DepthFirstIterator.h" +#include "llvm/ADT/SmallPtrSet.h" using namespace llvm; namespace { @@ -51,11 +52,11 @@ FunctionPass *llvm::createUnreachableBlockEliminationPass() { } bool UnreachableBlockElim::runOnFunction(Function &F) { - std::set<BasicBlock*> Reachable; + SmallPtrSet<BasicBlock*, 8> Reachable; // Mark all reachable blocks. - for (df_ext_iterator<Function*> I = df_ext_begin(&F, Reachable), - E = df_ext_end(&F, Reachable); I != E; ++I) + for (df_ext_iterator<Function*, SmallPtrSet<BasicBlock*, 8> > I = + df_ext_begin(&F, Reachable), E = df_ext_end(&F, Reachable); I != E; ++I) /* Mark all reachable blocks */; // Loop over all dead blocks, remembering them and deleting all instructions @@ -101,11 +102,12 @@ Y("unreachable-mbb-elimination", const PassInfo *const llvm::UnreachableMachineBlockElimID = &Y; bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) { - std::set<MachineBasicBlock*> Reachable; + SmallPtrSet<MachineBasicBlock*, 8> Reachable; // Mark all reachable blocks. - for (df_ext_iterator<MachineFunction*> I = df_ext_begin(&F, Reachable), - E = df_ext_end(&F, Reachable); I != E; ++I) + for (df_ext_iterator<MachineFunction*, SmallPtrSet<MachineBasicBlock*, 8> > + I = df_ext_begin(&F, Reachable), E = df_ext_end(&F, Reachable); + I != E; ++I) /* Mark all reachable blocks */; // Loop over all dead blocks, remembering them and deleting all instructions |