diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-02 00:17:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-02 00:17:47 +0000 |
commit | 43f33dd550a2d165c41cbf01cae97d513dd5002c (patch) | |
tree | 18b9610a956fa4d7b81bdd1e792381e3c5e77660 /llvm/tools/llvm-prof/llvm-prof.cpp | |
parent | f7691d398dd2c240eb6b01fbe2bfd07ef7a923ee (diff) | |
download | bcm5719-llvm-43f33dd550a2d165c41cbf01cae97d513dd5002c.tar.gz bcm5719-llvm-43f33dd550a2d165c41cbf01cae97d513dd5002c.zip |
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.
llvm-svn: 74676
Diffstat (limited to 'llvm/tools/llvm-prof/llvm-prof.cpp')
-rw-r--r-- | llvm/tools/llvm-prof/llvm-prof.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/llvm-prof/llvm-prof.cpp b/llvm/tools/llvm-prof/llvm-prof.cpp index cab87e73058..2cff296ba99 100644 --- a/llvm/tools/llvm-prof/llvm-prof.cpp +++ b/llvm/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"; } |