summaryrefslogtreecommitdiff
path: root/tools/llvm-prof
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-02 00:17:47 +0000
committerDan Gohman <gohman@apple.com>2009-07-02 00:17:47 +0000
commitf530c92cd55f35f64904e42e38b3a2bc92b347cb (patch)
tree90599072a77b48b5306f061b7006dcff85bf21d7 /tools/llvm-prof
parentc70e62110b7e165ab8f04c38ffd97f905dcda95d (diff)
downloadllvm-f530c92cd55f35f64904e42e38b3a2bc92b347cb.tar.gz
llvm-f530c92cd55f35f64904e42e38b3a2bc92b347cb.tar.bz2
llvm-f530c92cd55f35f64904e42e38b3a2bc92b347cb.tar.xz
Fix a bunch of other places that used operator[] to test whether
a key is present in a std::map or DenseMap to use find instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-prof')
-rw-r--r--tools/llvm-prof/llvm-prof.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp
index cab87e7305..2cff296ba9 100644
--- a/tools/llvm-prof/llvm-prof.cpp
+++ b/tools/llvm-prof/llvm-prof.cpp
@@ -81,8 +81,10 @@ namespace {
virtual void emitBasicBlockStartAnnot(const BasicBlock *BB,
raw_ostream &OS) {
if (BlockFreqs.empty()) return;
- if (unsigned Count = BlockFreqs[BB])
- OS << "\t;;; Basic block executed " << Count << " times.\n";
+ std::map<const BasicBlock *, unsigned>::const_iterator I =
+ BlockFreqs.find(BB);
+ if (I != BlockFreqs.end())
+ OS << "\t;;; Basic block executed " << I->second << " times.\n";
else
OS << "\t;;; Never executed!\n";
}