aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-12 22:22:18 +0000
committerChris Lattner <sabre@nondot.org>2004-12-12 22:22:18 +0000
commit4e51ccdd38338c93b189b1e21e50e597f698c034 (patch)
tree03146e231e3b23e724420aa8d70798f67ec39f96 /lib/Transforms
parent188839a2193005e6ee48b1189402d71edcd2a456 (diff)
Remove some more set operations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/ADCE.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp
index c7d349932c..fde1308aba 100644
--- a/lib/Transforms/Scalar/ADCE.cpp
+++ b/lib/Transforms/Scalar/ADCE.cpp
@@ -283,10 +283,8 @@ bool ADCE::doADCE() {
BasicBlock *BB = I->getParent();
if (!ReachableBBs.count(BB)) continue;
- if (!AliveBlocks.count(BB)) { // Basic block not alive yet...
- AliveBlocks.insert(BB); // Block is now ALIVE!
+ if (AliveBlocks.insert(BB).second) // Basic block not alive yet.
markBlockAlive(BB); // Make it so now!
- }
// PHI nodes are a special case, because the incoming values are actually
// defined in the predecessor nodes of this block, meaning that the PHI
@@ -294,10 +292,8 @@ bool ADCE::doADCE() {
//
if (PHINode *PN = dyn_cast<PHINode>(I))
for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI)
- if (!AliveBlocks.count(*PI)) {
- AliveBlocks.insert(BB); // Block is now ALIVE!
+ if (AliveBlocks.insert(*PI).second) // Block is now ALIVE!
markBlockAlive(*PI);
- }
// Loop over all of the operands of the live instruction, making sure that
// they are known to be alive as well...