diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-07-06 22:21:45 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-07-06 22:21:45 +0000 |
commit | 3ea4c49709c5bba5f8b16c6ceb725d9b9a1c48c6 (patch) | |
tree | f27cc7483d11a49d974b3015791e95aad522e031 /lib/Sema/AnalysisBasedWarnings.cpp | |
parent | 08aa622ab923fb8a2751f213feee0b9124ee86fb (diff) |
Based on comments from Chris, switch to using CFG::getNumBlockIDs()
rather than a computed std::distance(). At some point I had convinced
myself that these two were different; but as far as I can tell on
re-exampination they aren't, and the number of block IDs is actually
just a count of the blocks in the CFG.
While this removes the primary motivation for guarding all of this with
CollectStats, I have a patch coming up that will almost certainly make
it important again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134552 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/AnalysisBasedWarnings.cpp')
-rw-r--r-- | lib/Sema/AnalysisBasedWarnings.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 8a4634df2f..089fe7bf3c 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -741,10 +741,9 @@ AnalysisBasedWarnings::IssueWarnings(sema::AnalysisBasedWarnings::Policy P, if (CFG *cfg = AC.getCFG()) { // If we successfully built a CFG for this context, record some more // detail information about it. - unsigned NumBlocks = std::distance(cfg->begin(), cfg->end()); - NumCFGBlocks += NumBlocks; + NumCFGBlocks += cfg->getNumBlockIDs(); MaxCFGBlocksPerFunction = std::max(MaxCFGBlocksPerFunction, - NumBlocks); + cfg->getNumBlockIDs()); } else { ++NumFunctionsWithBadCFGs; } |