Summary:
The conf-clean target removes Makefiles that used to be generated by
autoconf, but aren't any longer.
Differential Revision: D3431186
fbshipit-source-id: c453f00
Summary:
Now that array types record only static - and therefore constant -
lengths, Sil typ and exp no longer need to be mutually recursive.
This diff:
- splits the recursion in the type definitions of typ and exp,
- splits the recursion in the comparison and pretty-printing
functions,
- and then refactors typ into a separate module.
Reviewed By: cristianoc
Differential Revision: D3423575
fbshipit-source-id: 6130630
Summary:
Assume that std::vector::resize will always create nonempty vector. While this is clearly
wrong for resize(0), it removes many FPs for `resize(n)` calls, where value of `n` is unknown.
Without it, infer was thinking that `n` could be 0 and reported empty vector access.
Reviewed By: jvillard
Differential Revision: D3424355
fbshipit-source-id: cb476de
Summary:
This diff refactors Sil.Int, which represents integer literals, into a
separate module IntLit. There are no dependencies forcing Sil.Int to
be a submodule of Sil, and it is also no simpler as a submodule.
Reviewed By: cristianoc
Differential Revision: D3422910
fbshipit-source-id: 63013f2
Summary:
Change int_compare to avoid overflow, without generating a call to a C
function or any branch instructions.
Reviewed By: cristianoc
Differential Revision: D3417671
fbshipit-source-id: e4c5d7b
Summary:
Reuse data fields of model's superclass (which is actual implementation).
Not very pretty, but makes sizeof shared_ptr same as in actual libraries
Reviewed By: jvillard
Differential Revision: D3398628
fbshipit-source-id: bdb9418
Summary:
Array types where the length is not statically known were represented
using fresh variables. This diff:
- Makes array type length optional, reducing the amount of work needed
for renaming, substitution, and normalization.
- Revises uses of array length so that the length component of a
Tarray type represents only the statically determined constant
length of an array type, and the length component of a Sizeof
expression represents the dynamically determined length of an array
value.
- Restricts the type of static lengths from a general expression
(Sil.exp) to an integer (Sil.Int.t), enforcing that static types are
constant. This in particular ensures that types contain no
variables, and so are invariant under operations such as renaming
and substitution.
- Removes the type substitution and renaming functions typ_sub,
typ_normalize, and typ_captured_ren. Now that array type lengths
are constant integers, all of these functions are the identity.
Reviewed By: cristianoc
Differential Revision: D3387343
fbshipit-source-id: b5db768
Summary:
The extra dereference in stmtexpr was wrong. When a dereference is needed, we have a cast.
This was causing one dereference too many, and creating wrong results.
Reviewed By: akotulski
Differential Revision: D3393294
fbshipit-source-id: 7a1ec8e
Summary:
Use the output of `clang -###` to drive which commands to run. Attach the plugin to all commands starting with `-cc1`.
Benefits:
- support for compiling multiple files in one clang command, eg `infer -- clang -c file1.c file2.c`
- support for compile commands that do not target a `.o` file, eg `infer -- clang -S hello.c`
- support for `-cc1` compile commands
- more generally, run all commands that clang would run, and attach plugin in all compilation cases
Reviewed By: martinoluca
Differential Revision: D3366912
fbshipit-source-id: 98d5e3b
Summary:
buck #infer flavor doesn't rely on .o files so we don't need to generate them.
It will save memory/IO and possibly time
Reviewed By: jvillard, martinoluca
Differential Revision: D3379463
fbshipit-source-id: 1d48f7a
Summary:
This diff extends Sizeof expressions with an optional expression for the
length of the final extensible array, if any. For example, sizeof a
simple array `sizeof(t[n])` is represented by (modulo subtyping info)
`Sizeof t (Some n)`, and sizeof a struct whose final member is an array
`sizeof(struct s {... t[n] f})` is represented by `Sizeof (struct s
{... t[n] f}) (Some n)`.
This is an intermediate step toward eliminating expressions from types,
the redundancy between the length in the types and in the sizeof
expressions will be eliminated later.
Reviewed By: cristianoc
Differential Revision: D3358763
fbshipit-source-id: 2239bca
Summary:
This removes some boilerplate and duplicated code and makes it easier to add
more tests.
Reviewed By: martinoluca, jeremydubreil
Differential Revision: D3365807
fbshipit-source-id: 9a2e0e5
Summary:
Came across when trying to compile infer on fresh VM.
Infer depends on reason now. Reason requires ocaml 4.02.3
Reviewed By: jberdine
Differential Revision: D3371378
fbshipit-source-id: 598c602
Summary:
Run `InferStatsAggregator` at the end of the execution of `infer` top-level, and store
results on `infer-out/(frontend|backend|reporting)_stats/aggregated_stats.json`
Not ready yet for buck targets analyzed without the use of an `#infer*` flavor.
Reviewed By: jvillard
Differential Revision: D3365504
fbshipit-source-id: 98b2eb3
Summary: It is preferable to always create error reports as a proof of succesful termination, even when the Buck target contains no source file to analyze
Reviewed By: sblackshear, jvillard
Differential Revision: D3362581
fbshipit-source-id: 4f27666
Summary:
Specs files can become stale and cause crashes if the serialized format
changes. It is unclear how to add the right dependencies to the
existing targets, so this patch just removes them. Perhaps when the
specs are built we should drop an empty file to time-stamp them, and add
a target that depends on e.g. InferAnalyze and produces that file, and
then add dependencies on it.
Reviewed By: jvillard
Differential Revision: D3358460
fbshipit-source-id: d8aee48