From 0e5444bb208540d374c0422434986ad828ef0468 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 26 Mar 2007 20:40:50 +0000 Subject: [PATCH] eliminate use of std::set git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35361 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/InstructionCombining.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index c545bd67f5c..3c06558d15b 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 -#include -#ifndef NDEBUG #include -#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 &PotentiallyDeadPHIs) { +static bool DeadPHICycle(PHINode *PN, + SmallPtrSet &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(PN->use_back())) @@ -7844,7 +7842,7 @@ Instruction *InstCombiner::visitPHINode(PHINode &PN) { if (PN.hasOneUse()) { Instruction *PHIUser = cast(PN.use_back()); if (PHINode *PU = dyn_cast(PHIUser)) { - std::set PotentiallyDeadPHIs; + SmallPtrSet PotentiallyDeadPHIs; PotentiallyDeadPHIs.insert(&PN); if (DeadPHICycle(PU, PotentiallyDeadPHIs)) return ReplaceInstUsesWith(PN, UndefValue::get(PN.getType()));