diff options
author | Chris Lattner <sabre@nondot.org> | 2007-03-26 20:40:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-03-26 20:40:50 +0000 |
commit | 0e5444bb208540d374c0422434986ad828ef0468 (patch) | |
tree | 061846233dc1a03be993b74a426a8d7ddfd27530 /lib/Transforms | |
parent | 4ada00d166b1d265fa4e751b63d7f869c7541f1b (diff) | |
download | external_llvm-0e5444bb208540d374c0422434986ad828ef0468.zip external_llvm-0e5444bb208540d374c0422434986ad828ef0468.tar.gz external_llvm-0e5444bb208540d374c0422434986ad828ef0468.tar.bz2 |
eliminate use of std::set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35361 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index c545bd6..3c06558 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -56,10 +56,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include <algorithm> -#include <set> -#ifndef NDEBUG #include <sstream> -#endif using namespace llvm; using namespace llvm::PatternMatch; @@ -7808,12 +7805,13 @@ Instruction *InstCombiner::FoldPHIArgOpIntoPHI(PHINode &PN) { /// DeadPHICycle - Return true if this PHI node is only used by a PHI node cycle /// that is dead. -static bool DeadPHICycle(PHINode *PN, std::set<PHINode*> &PotentiallyDeadPHIs) { +static bool DeadPHICycle(PHINode *PN, + SmallPtrSet<PHINode*, 16> &PotentiallyDeadPHIs) { if (PN->use_empty()) return true; if (!PN->hasOneUse()) return false; // Remember this node, and if we find the cycle, return. - if (!PotentiallyDeadPHIs.insert(PN).second) + if (!PotentiallyDeadPHIs.insert(PN)) return true; if (PHINode *PU = dyn_cast<PHINode>(PN->use_back())) @@ -7844,7 +7842,7 @@ Instruction *InstCombiner::visitPHINode(PHINode &PN) { if (PN.hasOneUse()) { Instruction *PHIUser = cast<Instruction>(PN.use_back()); if (PHINode *PU = dyn_cast<PHINode>(PHIUser)) { - std::set<PHINode*> PotentiallyDeadPHIs; + SmallPtrSet<PHINode*, 16> PotentiallyDeadPHIs; PotentiallyDeadPHIs.insert(&PN); if (DeadPHICycle(PU, PotentiallyDeadPHIs)) return ReplaceInstUsesWith(PN, UndefValue::get(PN.getType())); |