summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/LoopInfo.h
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-01-04 21:41:24 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-01-04 21:41:24 +0000
commitda69f3b357097e75fbf9a5a2bbe1e7273d4b4271 (patch)
tree809c659b191a97d91d60d2132234ed56bb5e42f2 /include/llvm/Analysis/LoopInfo.h
parent85c07ce0481daa8f462943f621efdb7f21f6d3ef (diff)
downloadllvm-da69f3b357097e75fbf9a5a2bbe1e7273d4b4271.tar.gz
llvm-da69f3b357097e75fbf9a5a2bbe1e7273d4b4271.tar.bz2
llvm-da69f3b357097e75fbf9a5a2bbe1e7273d4b4271.tar.xz
Simplify more DenseMap.find users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147550 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/LoopInfo.h')
-rw-r--r--include/llvm/Analysis/LoopInfo.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h
index 871735224d..f807d48d4e 100644
--- a/include/llvm/Analysis/LoopInfo.h
+++ b/include/llvm/Analysis/LoopInfo.h
@@ -655,9 +655,7 @@ public:
/// block is in no loop (for example the entry node), null is returned.
///
LoopT *getLoopFor(const BlockT *BB) const {
- typename DenseMap<BlockT *, LoopT *>::const_iterator I=
- BBMap.find(const_cast<BlockT*>(BB));
- return I != BBMap.end() ? I->second : 0;
+ return BBMap.lookup(const_cast<BlockT*>(BB));
}
/// operator[] - same as getLoopFor...
@@ -696,9 +694,7 @@ public:
/// the loop hierarchy tree.
void changeLoopFor(BlockT *BB, LoopT *L) {
if (!L) {
- typename DenseMap<BlockT *, LoopT *>::iterator I = BBMap.find(BB);
- if (I != BBMap.end())
- BBMap.erase(I);
+ BBMap.erase(BB);
return;
}
BBMap[BB] = L;
@@ -755,7 +751,7 @@ public:
}
LoopT *ConsiderForLoop(BlockT *BB, DominatorTreeBase<BlockT> &DT) {
- if (BBMap.find(BB) != BBMap.end()) return 0;// Haven't processed this node?
+ if (BBMap.count(BB)) return 0; // Haven't processed this node?
std::vector<BlockT *> TodoStack;