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.
After updating the function type conversion to be extra strict about
type alignment, the model-to-header tests for all these primitive
types no longer pass: it's no longer valid for a CFT to use any
primitives ABI is not aware of as part of the prototype.
As a simple workaround, this commit replaces all the primitives
used by said prototypes with pointers.
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).
It's a useful shorthand for the cases where one only cares about
a constant number of top values in a range (i.e. first three elements of
a vector) and wants them as named variables. It can be used as:
`auto [First, Second, Third] = takeAsTuple<3>(MyVector)`.
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.
This commit adds the `TargetListContainer` container that allows storing
a list of target for a fixed Kind. Moreover the
`PopulateTargetListContainer` pipe has been added that allows adding all
targets to a `TargetListContainer` from a `Kind` via the
`appendAllTargets` method.
Generalize `FunctionStringMap` into `detail::GenericStringMap`, which
supports any `Depth=1` rank. `FunctionStringMap` remains as an `using`
with `Rank = ranks::Function`.