Summary:
@public
This is a workaround to a clang crash that happens whenever `-fmodules` and `YojsonASTExporter` are used together.
This workaround, uses the `-plugin` argument instead of `-add-plugin` one for the clang frontend, and as a result of that, it overrides the default action of clang, which means no object files are emitted, but just the AST.
To generate the missing data needed by the subsequent building phases of xcodebuild, we run Apple's clang.
Test Plan:
Compiled project containing Pods and `@import`, through a command of the form:
infer -- xcodebuild -workspace project_name.xcworkspace -scheme project_name -sdk iphonesimulator
Summary:
@public
The clang location information is described in an incremental way: each location information is a delta with respect to the previous one in the AST. This is based on a the visit of the AST nodes which corresponds to the order in which the lines are printed with the standard clang AST dump:
clang -cc1 -ast-dump filename.c
This diff adds a preprocessing phase to the front-end so that location information is composed during a visit, and explicit location information is used instead.
In the case of include files, we report the last known location before including the file.
The current file for a function is the file where it is defined. So if a function is entirely defined in a .h file, then the location information will consistently be about the .h file. If instead a function is defined in the source file being analyzed, and some AST nodes come from macro expansion, line information will refer to the original file.
The front-end tests reveal that the location information was incorrect in a few dot files.
Test Plan: arc unit, after having fixed the wrong location in the existing .dot files
Summary:
report_number is zero before the conditions
Closes https://github.com/facebook/infer/pull/74
Github Author: Chase choi <cs09gi@gmail.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
While working on building a quick Homebrew formula for this, I ran into symlink-related issues around the libs folder. This seems to fix it with minimal impact.
Closes https://github.com/facebook/infer/pull/13
Github Author: Dan Ambrisco <dambrisco@gmail.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
@public
This adds a script `inferTraceBugs` to `infer/bin/` that
1. shows the list of bugs found by Infer to the user
2. asks which one to display
3. asks what max level of nested procedure calls to display
4. shows the error trace of that bug with some lines of context in the source
code
Also has some options to script more easily, for instance when calling it from
inside an editor to navigate the sources.
Test Plan:
infer -o out -- gcc -c hello.c
inferTraceBugs -o out
also tested on OpenSSL.
In emacs, run `M-x compile` from the directory where `infer-out` is, then enter custom compilation command:
inferTraceBugs --select 0 --max-level max --no-source
Then navigate the trace with `M-g n`.
Summary:
@public
Even though internally we recover from these errors, we still show them on
standard output. Redirect errors to /dev/null instead.
Test Plan:
infer -- buck build target
doesn't complain that git crashes on non-git repositories.
Summary:
@public
This changes "Starting analysis" into
"Starting analysis (Infer version XXX)".
Test Plan:
infer -- clang -c hello.c
shows "Starting analysis (Infer version git-6b9fb8838bcabd2af881554d296963a849b14f50)"
Summary:
@public
We were counting the number of matches for `infer-out/captured/*/*.cfg`, but
some ways of running infer (eg, inferJ) do not produce cfgs. Instead, count the
number of directorys `infer-out/captured/*/`.
Test Plan:
make -C infer java
reports the number of models analysed instead of 0.