summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-05-10 18:04:43 +0000
committerAnna Zaks <ganna@apple.com>2013-05-10 18:04:43 +0000
commit3feb2cd5bbbeeba4a7dba3179ec6f93fc3cbb6c8 (patch)
tree996910de6e69fbaf5f8918992aba0b24628b1f9e
parentb3a25fa5801160c75cc00f6fb2aef3a81adb0456 (diff)
downloadbcm5719-llvm-3feb2cd5bbbeeba4a7dba3179ec6f93fc3cbb6c8.tar.gz
bcm5719-llvm-3feb2cd5bbbeeba4a7dba3179ec6f93fc3cbb6c8.zip
[analyzer] Do not check if sys/queue.h file is a system header.
In most cases it is, by just looking at the name. Also, this check prevents the heuristic from working in strange user settings. radar://13839692 llvm-svn: 181615
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp5
-rw-r--r--clang/test/Analysis/diagnostics/Inputs/include/sys/queue.h1
2 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index a397f33c992..00c92d8153e 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -1539,12 +1539,11 @@ LikelyFalsePositiveSuppressionBRVisitor::getEndPath(BugReporterContext &BRC,
SourceManager &SM = BRC.getSourceManager();
FullSourceLoc Loc = BR.getLocation(SM).asLocation();
while (Loc.isMacroID()) {
- if (SM.isInSystemMacro(Loc) &&
- (SM.getFilename(SM.getSpellingLoc(Loc)).endswith("sys/queue.h"))) {
+ Loc = Loc.getSpellingLoc();
+ if (SM.getFilename(Loc).endswith("sys/queue.h")) {
BR.markInvalid(getTag(), 0);
return 0;
}
- Loc = Loc.getSpellingLoc();
}
return 0;
diff --git a/clang/test/Analysis/diagnostics/Inputs/include/sys/queue.h b/clang/test/Analysis/diagnostics/Inputs/include/sys/queue.h
index e5698ed443b..2740e174f25 100644
--- a/clang/test/Analysis/diagnostics/Inputs/include/sys/queue.h
+++ b/clang/test/Analysis/diagnostics/Inputs/include/sys/queue.h
@@ -1,4 +1,3 @@
-#pragma clang system_header
void free(void *);
#define FREE_POINTER(x) free(x)
OpenPOWER on IntegriCloud