Dulma Churchill
47f1c6ffac
[linters] Global paths
...
Reviewed By: ddino
Differential Revision: D5228481
fbshipit-source-id: ab8b542
8 years ago
Dulma Churchill
99a0f894b6
[linters] Add option to blacklist the unavailable api check for some files
...
Reviewed By: jberdine
Differential Revision: D5236287
fbshipit-source-id: ef801ee
8 years ago
Dulma Churchill
dfca0cdcf7
[linters] Introduce whitelist and blacklist path, also multiple paths
...
Reviewed By: ddino
Differential Revision: D5209648
fbshipit-source-id: dbb77c2
8 years ago
Don Stewart
35ac57c378
Typo in message.
...
Reviewed By: dulmarod
Differential Revision: D5217194
fbshipit-source-id: 1b3a039
8 years ago
Dulma Churchill
57dd45dd82
[linters] Improve the error message in implicit cast error
...
Reviewed By: jvillard
Differential Revision: D5202360
fbshipit-source-id: 78611f1
8 years ago
Dino Distefano
55da0055c9
Predicate for `using namespace`
...
Reviewed By: dulmarod
Differential Revision: D5172430
fbshipit-source-id: 0cd9251
8 years ago
Dulma Churchill
03bdf0fe2c
[linters] Cast from pointer to integer
...
Reviewed By: jvillard
Differential Revision: D5157470
fbshipit-source-id: 5385b5a
8 years ago
Martino Luca
2e8e5733f6
[AL] Load AL files from a directory
...
Reviewed By: dulmarod
Differential Revision: D5155036
fbshipit-source-id: 35ac690
8 years ago
Dino Distefano
0809279b3b
Extending type parser to deal with typedefs
...
Reviewed By: dulmarod
Differential Revision: D5155322
fbshipit-source-id: 9af8d8b
8 years ago
Dulma Churchill
46a539df82
[linters] Specify path in linters
...
Reviewed By: jvillard
Differential Revision: D5146904
fbshipit-source-id: 62b9d78
8 years ago
Dulma Churchill
f5d3870485
[linters] Adding a new error type like
...
Reviewed By: martinoluca
Differential Revision: D5111078
fbshipit-source-id: 06e14b8
8 years ago
Dino Distefano
4e7c7f30c1
Extended transitions to universal quantified operators
...
Reviewed By: dulmarod
Differential Revision: D5094722
fbshipit-source-id: a20e96b
8 years ago
Dino Distefano
e77ca182a5
Added a lint for namespace
...
Reviewed By: dulmarod
Differential Revision: D5103566
fbshipit-source-id: 4092e73
8 years ago
Dino Distefano
bdd2395be6
Adding ability to get type of paramters.
...
Reviewed By: dulmarod
Differential Revision: D5069844
fbshipit-source-id: c591f76
8 years ago
Dino Distefano
cfd0a9b038
Extending type parser to parse ObjC classes.
...
Reviewed By: dulmarod
Differential Revision: D5052238
fbshipit-source-id: b678c32
8 years ago
Jules Villard
93ec47a5f4
[IR] add stride to array type
...
Summary:
An array has a static or dynamic length (number of elements), but it also has a
stride, determined by the type of the element: `sizeof(element_type)`. We don't
have a good `sizeof()` function available on SIL types, so record that stride
in the array type.
update-submodule: facebook-clang-plugins
Reviewed By: mbouaziz
Differential Revision: D4969697
fbshipit-source-id: 98e0670
8 years ago
Jules Villard
801c605c26
[CLI] switch to infer-<command> (symlinks) executables
...
Summary:
Introduce `infer-<command>` for each command, except for internal commands
(only `infer-clang` for now) which are not exported. Install these executables
(which are just symlinks to `infer`) on `make install`. The main executable
looks at the name it was invoked with to figure out if it should behave as a
particular command.
Get rid of `InferClang`, `InferAnalyze`, and `InferPrint`. As a bonus, we now
only need to build one executable: `infer`, which should be a few seconds
faster (less link time).
`InferAnalyze` is now `infer-analyze` and `InferPrint` is `infer-print`. To run
`InferClang`, use a symlink named `clang`, `clang++`, etc. to `infer`. There
are such symlinks available in "infer/lib/wrappers/" already.
I also noticed that the scripts in xcodebuild_wrappers/ don't seem useful
anymore, so use wrappers/ instead, as for `make`.
Reviewed By: mbouaziz
Differential Revision: D5036495
fbshipit-source-id: 4a90030
8 years ago
Dino Distefano
99552edd7b
Extending type parser to parse pointer types.
...
Reviewed By: dulmarod
Differential Revision: D5036673
fbshipit-source-id: c16e311
8 years ago
Dulma Churchill
c9670d215d
[linters] Add new predicate has_type and check for implicit cast
...
Reviewed By: ddino
Differential Revision: D5025959
fbshipit-source-id: de7eb55
8 years ago
Dino Distefano
c6a29e5e8a
Adding more builtin type to parser
...
Reviewed By: dulmarod
Differential Revision: D5027944
fbshipit-source-id: 050c44c
8 years ago
Dulma Churchill
1a141eddca
[ObjC capture] Model functions related to dispatch sources
...
Reviewed By: akotulski
Differential Revision: D4994125
fbshipit-source-id: 34ce0a8
8 years ago
Dulma Churchill
6097c05d88
[clang] Add a preanalysis to compute nullability annotations
...
Reviewed By: sblackshear
Differential Revision: D4884502
fbshipit-source-id: e0b12a5
8 years ago
Dino Distefano
5bb41cc18c
Removing predicates _strict
...
Reviewed By: dulmarod
Differential Revision: D4863173
fbshipit-source-id: 671ef75
8 years ago
Dino Distefano
3c6f53c896
Adding predicate to get return type of a method and start a new parser for types
...
Reviewed By: dulmarod
Differential Revision: D4863095
fbshipit-source-id: c966d1d
8 years ago
Andrzej Kotulski
462220ce3e
[typ] Print type qualifiers in Typ.pp_full
...
Summary:
Title.
The way types are printed is completely valid, but little weird for some C++ programmers:
`int const` - same as `const int`
`int * const` - pointer is `const`, value under it is not
`int const *` - pointer is not `const`, but the value is
`int const * const` - both pointer and value are const
Reviewed By: jberdine
Differential Revision: D4962180
fbshipit-source-id: dcb02e3
8 years ago
Jules Villard
1b0ee6fbc3
[clang] add sizeof static value to translation
...
Summary:
Modify the type of `Exp.Sizeof ...` to include the value that the expression
evaluates to according to the compiler, or None if it cannot be known
statically.
Use this information in inferbo.
Mostly unused in the BiAbduction checker for now, although it could be useful
there too.
update-submodule: facebook-clang-plugins
Reviewed By: mbouaziz
Differential Revision: D4953634
fbshipit-source-id: be0999d
8 years ago
Dino Distefano
7cef8ae3b5
Making AL distinguish class methods from instance methods
...
Reviewed By: dulmarod
Differential Revision: D4826401
fbshipit-source-id: 97c2570
8 years ago
Andrzej Kotulski
62d1d74d74
[Typ] Change Typ.pp_full to not include class keywords
...
Reviewed By: jvillard
Differential Revision: D4843009
fbshipit-source-id: 5d0aaa3
8 years ago
Dino Distefano
3ebf8c3277
Added the capability to import macros files in AL
...
Reviewed By: dulmarod
Differential Revision: D4754545
fbshipit-source-id: e8fa4fa
8 years ago
Paco Estevez Garcia
5482f110c1
Add type path_exec to represent an skipped path of execution. Add logic to symExec to report skipped paths
...
Summary:
Adds a new type and branching for a missing path of execution.
closes #575
Reviewed By: jvillard
Differential Revision: D4738681
fbshipit-source-id: f72344c
8 years ago
Jules Villard
3ab6c43fb6
[tests] awesomize make output
...
Summary:
Hide the output of all the toplevel `make` actions and print messages instead, as if we had a better build system than Makefiles. When a command fails, print its stdout and stderr and prefix it with bold red letters. Also display timing information.
```
$ make -j 4 test
[17:39:18][27290] Facebook setup...
[17:39:18][27363] Building checkCopyright...
[17:39:18][27443] Validating facebook/...
[ 0s][27363] SUCCESS Building checkCopyright
[ 0s][27290] SUCCESS Facebook setup
[17:39:18][27863] Building clang plugin...
[ 0s][27443] SUCCESS Validating facebook/
[ 0s][27863] SUCCESS Building clang plugin
[17:39:18][27898] Building clang plugin OCaml interface...
[ 0s][27898] SUCCESS Building clang plugin OCaml interface
[17:39:18][27974] Testing Infer builds without warnings...
[17:39:18][28033] Building native Infer...
[ 12s][27974] SUCCESS Testing Infer builds without warnings
[17:39:30][28998] Testing Infer toplevel builds...
[ 6s][28998] SUCCESS Testing Infer toplevel builds
[17:39:36][31417] Running OCaml unit tests...
[17:39:36][31456] Testing infer OCaml REPL...
[ 6s][31417] SUCCESS Running OCaml unit tests
[ 9s][31456] SUCCESS Testing infer OCaml REPL
[ 92s][28033] SUCCESS Building native Infer
[17:40:50][ 2170] Building Java annotations...
[ 0s][ 2170] SUCCESS Building Java annotations
[17:40:50][ 2186] Building Infer models...
[ 11s][ 2186] SUCCESS Building Infer models
[17:41:01][ 2803] Running build assembly test...
[17:41:01][ 2861] Running build ck analytics test...
[17:41:01][ 2941] Running build ck imports test...
[17:41:01][ 3035] Running build clang compilation db escaped test...
[ 1s][ 3035] SUCCESS Running build clang compilation db escaped test
[17:41:02][ 3139] Running build clang compilation db relpath test...
[ 3s][ 2861] SUCCESS Running build ck analytics test
[17:41:04][ 3296] Running build clang multiple files test...
[*ERROR**][2803] *** ERROR Running build assembly test
[*ERROR**][2803] *** command: ( make INTERACTIVE=1 -C /home/jul/infer/infer/tests/build_systems/assembly test 2> >(grep -v warning: (ignoring old|overriding) (commands|recipe) for target) ; exit 0)
[*ERROR**][2803] *** CWD: /home/jul/infer
[*ERROR**][2803] *** stdout:
[*ERROR**][2803] make[1]: Entering directory '/home/jul/infer/infer/tests/build_systems/assembly'
[*ERROR**][2803] *** inner Testing infer/clang in build_systems/assembly
[*ERROR**][2803] *** inner command: /home/jul/infer/infer/bin/infer --results-dir infer-out --dump-duplicate-symbols --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed -a infer -- clang -c ../codetoanalyze/example.S ../codetoanalyze/hello.c
[*ERROR**][2803] *** inner CWD: /home/jul/infer/infer/tests/build_systems/assembly
[*ERROR**][2803] Capturing in make/cc mode...
[*ERROR**][2803] Starting analysis...
[*ERROR**][2803]
[*ERROR**][2803] legend:
[*ERROR**][2803] "F" analyzing a file
[*ERROR**][2803] "." analyzing a procedure
[*ERROR**][2803]
[*ERROR**][2803] Found 1 (out of 1) source files to be analyzed in /home/jul/infer/infer/tests/build_systems/assembly/infer-out
[*ERROR**][2803]
[*ERROR**][2803]
[*ERROR**][2803] No issues found
[*ERROR**][2803]
[*ERROR**][2803] ../../infer.make:30: recipe for target 'test' failed
[*ERROR**][2803] make[1]: Leaving directory '/home/jul/infer/infer/tests/build_systems/assembly'
[*ERROR**][2803] F.--- build_systems/assembly/issues.exp 2017-03-22 16:25:44.583854270 +0000
[*ERROR**][2803] +++ build_systems/assembly/issues.exp.test 2017-03-28 17:41:04.743678254 +0100
[*ERROR**][2803] @@ -1 +0,0 @@
[*ERROR**][2803] -hello.c, test, 2, NULL_DEREFERENCE, [start of procedure test()]
[*ERROR**][2803]
[*ERROR**][2803] Test output (build_systems/assembly/issues.exp.test) differs from expected test output build_systems/assembly/issues.exp
[*ERROR**][2803] Run the following command to replace the expected test output with the new output:
[*ERROR**][2803]
[*ERROR**][2803] make -C build_systems/assembly replace
[*ERROR**][2803]
[*ERROR**][2803] make[1]: *** [test] Error 1
[*ERROR**][2803] *** stderr:
Makefile:230: recipe for target 'build_assembly_test' failed
make: *** [build_assembly_test] Error 1
make: *** Waiting for unfinished jobs....
[...]
```
Reviewed By: jberdine
Differential Revision: D4781857
fbshipit-source-id: cbce26d
8 years ago
Jules Villard
cd421b4a5f
[make] print @ commands when passed VERBOSE=1
...
Summary:
It can be useful when debugging infer or the Makefiles themselves to see what
`make` is doing. Instead of editing Makefiles to remove `@` now you can `make
VERBOSE=1`.
This is just `git ls-files | grep -e Makefile -e '.*\.make' | xargs sed -e 's/^\t@/\t$(QUIET)/' -i`, and adding the definition of `QUIET` to Makefile.config.
Reviewed By: jeremydubreil
Differential Revision: D4779115
fbshipit-source-id: e6e4642
8 years ago
Andrzej Kotulski
fbddeba8a7
[clang] Don't inline global var initializers
...
Reviewed By: jberdine
Differential Revision: D4786653
fbshipit-source-id: 22fd2b3
8 years ago
Dino Distefano
40e63aa42c
Added the capability to define macros in AL
...
Reviewed By: dulmarod
Differential Revision: D4721779
fbshipit-source-id: 52da9f0
8 years ago
Andrzej Kotulski
d4e9f0de64
[Makefile] Print duplicate symbols to separate file, not stderr
...
Summary:
All tests were redirecting `stderr` into duplicates.txt which made it much harder to see other error messages in stderr (such as uncaught exceptions).
To mitigate it, write duplicates to separate file and don't redirect `stderr` to another file.
Reviewed By: jvillard
Differential Revision: D4728938
fbshipit-source-id: 8ad2fc8
8 years ago
Dulma Churchill
565ce2166d
[ios] Translate nonnull annotations and take them into account in parameter not null checked issues.
...
Reviewed By: sblackshear
Differential Revision: D4706345
fbshipit-source-id: c7e0065
8 years ago
Dino Distefano
df543b900b
Making easier to specify subclassing
...
Reviewed By: dulmarod
Differential Revision: D4699748
fbshipit-source-id: 39f7c05
8 years ago
Jules Villard
dac8906d86
[make] make sure makefile uses config-time values
...
Summary:
This makes sure that one can run `./build-infer.sh` then `make`. Otherwise it's
not always clear what one should do to recompile infer, eg when `make` will
work and when `./build-infer.sh` should be used instead, in particular when the
user doesn't have opam configured for her terminal.
Reviewed By: jberdine
Differential Revision: D4698159
fbshipit-source-id: 5df8059
8 years ago
Andrzej Kotulski
6a02568982
[clang] Change procname file naming scheme
...
Summary:
Procnames files are now reversed qualifier lists with `#` as separator (instead of `::` which needs to be escaped in bash).
Because of the mechanism that is used to obtain qualifiers, it also affects naming for ObjC classes.
Examples:
```
std::unique_ptr<int>::get -> get#unique_ptr<int>#std#__MANGLED,...__ // C++ method
folly::split -> split#folly#__MANGLED,..._ // function within namespace
NSNumber numberWithBool: -> numberWithBool:#NSNumber#class // ObjC method
```
Reviewed By: jvillard
Differential Revision: D4689701
fbshipit-source-id: c3acfc6
8 years ago
Andrzej Kotulski
e08d9341c8
[clang] Run direct tests with --no-failures-allowed flag
...
Reviewed By: dulmarod
Differential Revision: D4674385
fbshipit-source-id: 0816239
8 years ago
Dulma Churchill
612e501dfc
[ios] Model NSData initWithBytesNoCopy:data length:dataLength
...
Reviewed By: akotulski
Differential Revision: D4666223
fbshipit-source-id: 2c88ce8
8 years ago
Dulma Churchill
15a0662149
[clang] Adding annotations for ObjC instance variables
...
Reviewed By: sblackshear
Differential Revision: D4649995
fbshipit-source-id: 668c2b8
8 years ago
Dulma Churchill
f549d58625
[ios] Capture the signature of getters and setters from headers.
...
Reviewed By: akotulski
Differential Revision: D4612126
fbshipit-source-id: 95c3f36
8 years ago
Dulma Churchill
461bd691ce
[clang] Translate nullable annotations of return types of methods
...
Reviewed By: sblackshear
Differential Revision: D4579234
fbshipit-source-id: 62cadf1
8 years ago
Dulma Churchill
d81b1644de
[ios] Enable npes for self in initializers
...
Reviewed By: ddino
Differential Revision: D4543364
fbshipit-source-id: 0c662c5
8 years ago
Dulma Churchill
6c82e82444
[linters] Fix one more unavailable api false positive
...
Reviewed By: akotulski
Differential Revision: D4578891
fbshipit-source-id: c6443a1
8 years ago
Dulma Churchill
3fb6e4dea7
[tests] Fixing the renaming issue with the lint tests
...
Reviewed By: martinoluca
Differential Revision: D4565163
fbshipit-source-id: 2be82f2
8 years ago
Dulma Churchill
9ac65a7b1d
[linters] Take current os version into account in the unavailable api check
...
Reviewed By: jvillard, martinoluca
Differential Revision: D4508223
fbshipit-source-id: c44b75d
8 years ago
Dulma Churchill
dbcb871988
[linters] Add extra case of respondsToSelector block
...
Reviewed By: martinoluca
Differential Revision: D4528659
fbshipit-source-id: face498
8 years ago
Dulma Churchill
269ea5ffe5
[linters] Take into account the respondsToSelector block in the unavailable api check
...
Reviewed By: martinoluca
Differential Revision: D4455886
fbshipit-source-id: 58d4d96
8 years ago