]> granicus.if.org Git - clang/commitdiff
[analyzer] Do not check if sys/queue.h file is a system header.
authorAnna Zaks <ganna@apple.com>
Fri, 10 May 2013 18:04:43 +0000 (18:04 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 10 May 2013 18:04:43 +0000 (18:04 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181615 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
test/Analysis/diagnostics/Inputs/include/sys/queue.h

index a397f33c9928b8a168270a847fb14c9ee3cf103c..00c92d8153ea9f1a7f9b8edaec541f492312a450 100644 (file)
@@ -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;
index e5698ed443b79852b32bd57fe115bb69ff5b88e6..2740e174f257b8f5293ead73e4abaa1acaff2c44 100644 (file)
@@ -1,4 +1,3 @@
-#pragma clang system_header
 
 void free(void *);
 #define FREE_POINTER(x) free(x)