forked from OSchip/llvm-project
[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
This commit is contained in:
parent
b3a25fa580
commit
3feb2cd5bb
|
|
@ -1539,12 +1539,11 @@ LikelyFalsePositiveSuppressionBRVisitor::getEndPath(BugReporterContext &BRC,
|
||||||
SourceManager &SM = BRC.getSourceManager();
|
SourceManager &SM = BRC.getSourceManager();
|
||||||
FullSourceLoc Loc = BR.getLocation(SM).asLocation();
|
FullSourceLoc Loc = BR.getLocation(SM).asLocation();
|
||||||
while (Loc.isMacroID()) {
|
while (Loc.isMacroID()) {
|
||||||
if (SM.isInSystemMacro(Loc) &&
|
Loc = Loc.getSpellingLoc();
|
||||||
(SM.getFilename(SM.getSpellingLoc(Loc)).endswith("sys/queue.h"))) {
|
if (SM.getFilename(Loc).endswith("sys/queue.h")) {
|
||||||
BR.markInvalid(getTag(), 0);
|
BR.markInvalid(getTag(), 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
Loc = Loc.getSpellingLoc();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#pragma clang system_header
|
|
||||||
|
|
||||||
void free(void *);
|
void free(void *);
|
||||||
#define FREE_POINTER(x) free(x)
|
#define FREE_POINTER(x) free(x)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue