[llvm-commits] [llvm] r54787 - in /llvm/trunk/lib: CodeGen/UnreachableBlockElim.cpp Target/X86/X86FloatingPoint.cpp
Owen Anderson
resistor at mac.com
Thu Aug 14 14:01:00 PDT 2008
Author: resistor
Date: Thu Aug 14 16:01:00 2008
New Revision: 54787
URL: http://llvm.org/viewvc/llvm-project?rev=54787&view=rev
Log:
Remove more uses of std::set.
Modified:
llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp
llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=54787&r1=54786&r2=54787&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original)
+++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Thu Aug 14 16:01:00 2008
@@ -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 @@
}
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 @@
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
Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=54787&r1=54786&r2=54787&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Thu Aug 14 16:01:00 2008
@@ -40,11 +40,11 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/DepthFirstIterator.h"
+#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include <algorithm>
-#include <set>
using namespace llvm;
STATISTIC(NumFXCH, "Number of fxch instructions inserted");
@@ -192,11 +192,11 @@
// Process the function in depth first order so that we process at least one
// of the predecessors for every reachable block in the function.
- std::set<MachineBasicBlock*> Processed;
+ SmallPtrSet<MachineBasicBlock*, 8> Processed;
MachineBasicBlock *Entry = MF.begin();
bool Changed = false;
- for (df_ext_iterator<MachineBasicBlock*, std::set<MachineBasicBlock*> >
+ for (df_ext_iterator<MachineBasicBlock*, SmallPtrSet<MachineBasicBlock*, 8> >
I = df_ext_begin(Entry, Processed), E = df_ext_end(Entry, Processed);
I != E; ++I)
Changed |= processBasicBlock(MF, **I);
More information about the llvm-commits
mailing list