aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-08-24 20:31:06 +0000
committerAnna Zaks <ganna@apple.com>2011-08-24 20:31:06 +0000
commit14924267950e75c6c1f6fcea39fa507b7168bc39 (patch)
tree1a184e0a4fc18ea5331d04b46e376dacea7d17da /lib/StaticAnalyzer/Core/BugReporter.cpp
parentef05abda02375a6565edcc0bdf20bdd41c0a87b3 (diff)
[analyzer] Allow checker writes to specify that no region should be accosiated with the report. (Useful when we report an error on endOfPath or deadSymbols, when the range of the last expression might have nothing to do with the error.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index fc28c587d2..70efacbd34 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -1273,6 +1273,10 @@ BugReport::getRanges() {
return std::make_pair(ranges_iterator(), ranges_iterator());
}
+ // User-specified absence of range info.
+ if (Ranges.size() == 1 && !Ranges.begin()->isValid())
+ return std::make_pair(ranges_iterator(), ranges_iterator());
+
return std::make_pair(Ranges.begin(), Ranges.end());
}