Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] Do not analyze bison-generated files
Bison/YACC generated files result in a very large number of (presumably) false positives from the analyzer. These false positives are "true" in a sense of the information analyzer sees: assuming that the lexer can return any token at any point a number of uninitialized reads does occur. (naturally, the analyzer can not capture a complex invariant that certain tokens can only occur under certain conditions). Current fix simply stops analysis on those files. I have examined a very large number of such auto-generated files, and they do all start with such a comment. Conversely, user code is very unlikely to contain such a comment. rdar://33608161 Differential Revision: https://reviews.llvm.org/D43421 llvm-svn: 326135
- Loading branch information
George Karpenkov
committed
Feb 26, 2018
1 parent
24f9794
commit 1d3e49e
Showing
2 changed files
with
74 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* A Bison parser, made by GNU Bison 1.875. */ | ||
|
||
// RUN: rm -rf %t.plist | ||
// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist -o %t.plist -verify %s | ||
// RUN: FileCheck --input-file=%t.plist %s | ||
|
||
// expected-no-diagnostics | ||
int foo() { | ||
int *x = 0; | ||
return *x; // no-warning | ||
} | ||
|
||
// CHECK: <key>diagnostics</key> |