This commit replaces all the uses on getTypeAllocSize with
getTypeStoreSize.
The result of the second method are more accurate, e.g. for i96
getTypeAllocSize returns 16, while getTypeStoreSize returns 12.
This makes it more suitable for reasoning about type sizes in a way that
is compatible with the model.
This commit drops ValueManipulationAnalysis, which in its original
design based on MinCut and Karger, was never enabled in the
decompilation pipeline.
Until now, VMA was only used in a severely weakened form in
initModelTypes. That for was so weakened that it barely did anything.
We already have a new design for VMA so that it can work before
DataLayoutAnalysis, and on Clift.
At this point, the old VMA is basically useless anyway, and the very few
occasions where it can do something will simply be solved by the
upcoming work on making some of the remaining casts implicit.
At this point it does not make sense to keep VMA alive anymore.
Before this commit, DLA didn't do any checks on the validity of the
model::PrimitiveTypes that it generated.
This could cause invalid PrimitiveTypes to be generated, with weird
sizes not supported by the Model.
This commit fixes this problem, generating empty model::StructTypes with
the proper sizes instead.
Before this commit, DLA's frontend was representing information about
string literals in a way that had a bad outcome: very often, all (or
most) places in the binary that were using string literals ended up
collapsed on the DLA graph on the same node, causing all their types to
be a weird struct.
This was wrong, and it was the result of an aggressive creation of
equality edges.
This commit avoids to emit equality edges, and replaces them with
instance edges, that represent the fact that a call to StringLiteral
actually returns a type that represents a pointer to char.
When there's a single struct argument (as in, all we see is a nested
struct) and all the sizes match, just use the inner struct instead of
creating a new one.
Because of a mistake in the previous iteration, an invalid iteration was
dereferenced when a struct had non-zero size but no fields (padding only
struct).
When running ModelToHeader in HeaderToModel, all types need to be
defined in the header for clang to successfully parse the file. Add an
option to `ModelToHeaderOptions` that forces all types to be printed
regardless of stack or inlining rules.
Generalize `FunctionStringMap` into `detail::GenericStringMap`, which
supports any `Depth=1` rank. `FunctionStringMap` remains as an `using`
with `Rank = ranks::Function`.