Before this commit we couldn't handle gracefully situations where the
model had an array with elements of given size X and the IR had strided
accesses with a stride Y that was larger than X.
This commit gracefully handles that case, but for now it always bail
out.
In the future we could think of handling this better if Y is a multiple
of X.
Before this commit, MakeModelGEPPass was materializing all possible
traversals of the type system to select the best match for translating
some pointer arithmetic on the IR into ModelGEPs.
This proved to be very slow and to do a lot of useless computation on
larger binaries with big type systems.
This commit partially rewrites MakeModelGEPPass to adopt a
branch-and-bound approach to only explore paths on the type system that
have some chance of improving the best match.
This commit removes the bugged addPointerQualifier helper function,
that was wrongly pushing the pointer qualifier at the end.
Instead, we now use the correct model::Binary::getPointerTo method.
ModelGEP calls in LLVM IR now return an integer that has the same
size of the field being addressed by the ModelGEP.
AddressOf calls, instead, can accept any integer size as argument but
always return a pointer-sized integer.
This comparison was used to sort the best results among candidates for
creating ModelGEPs.
However the comparison itself was broken, i.e. you could have 2
different QualifiedTypes T1 and T2 such that T1 < T2 AND T2 < T1.
This caused broken sorting and non-deterministic selection of the best
ModelGEP substitution.
This commit fixes the comparison and as a result the selection of the
best candidate for the emission of ModelGEPs is not completely
deterministic.
This flag was used with the old C backend to decompile only a single
function from a binary.
The logic of selecting functions in a binary for decompilation is now
part of revng-pipeline, so the -single-decompilation option and the
associated TargetFunctionOption library can be dropped.
Change company name to "rev.ng Labs Srl" in all license headers
to reflect changed company name and legal status
Add missing license headers to files that didn't have one
This commit relaxes some assertions related to DLA, that were too strict
for general type systems not generated by DLA, and fixes the scoring of
the best access to select ModelGEPs.
Before this commit we did not take into account a perfect type match
when deciding the best ModelGEP to emit.
This commit changes the score to take it into account and score higher a
ModelGEP with perfect type match.
Before this commit, SegregateStackAccessPass did not update properly the
metadata. Missing metadata did not allow the rest of the pipeline to
detect the special call.
This commit properly copies the metadata and updates the rest of the
pipeline to take care of the special call.