We used to support having a single `void` argument. It was for some
C-compatibility ambitions, but just omitting the argument is perfectly
fine.
Also, the DWARF importer has been fixed to handle typedef'd void as
arguments.
More in general, arguments are now required to always have a size.
A class or a struct type A can be a forward declaration and refer
to another type B in PDB, so we need to follow the references.
We pre-create type for B, when we face type A, and then, when we
visit type B, we populate the fields for the model::type we
pre-created.
In addition, this patch fixes some minor/side bugs:
- Handle SHORT/Int16Short simple type
- Do not delete model::Function if Prototype is invalid.
Replace the stub implementation of invalidation with the proper
implementation. A ReadPathCache is added to each global so that it can
keep tracks of what target are associated to which read paths.
One of the two passes to purge unused types from the model had a
ill-defined semantics.
This commit simplifies them in two passes: one that purges all the types
unreachable from outside `Binary::Types` and one that does the same but
also preserves types with a `CustomName` or an `OriginalName`.
Before this commit, the TypeSystemPrinter implicitly assumed that
model::Function and model::DynamicFunction always had a prototype.
However, this is not guaranteed by the model schema.
This commit extends the TypeSystemPrinter so that it doesn't make that
wrong assumption anymore, and can successfully print any model::Function
and model::DynamicFunction, even when a prototype is not present.
This commit improves the formalization of how we handle names.
The main changes are:
* Now `_` is a reserved prefix and all the generated names start with
`_`.
* The model verification routine now checks that `CustomName`s in the
global scope do not collide with any local namespace (e.g., fields of
a `StructType`).
* We changed the prefix `prefix_` to `unreserved_` to better convey the
fact that the prefix has been introduce to use an non-reserved name.
This commit switches `model::Type::ID` from being a GUID to be a
progressive number, in order to make things easier for humans.
On top of this, this commit introduces the following changes:
* TypeCopier: import all the necessary PrimitiveTypes and improve
handling of CustomName.
* Move Kind as the last field of the key of each TupleTree type used in
an `UpcastablePointer`.
* Update the ground truth of tests to ignore the `CustomName` in favor
of focusing on `OriginalName`.
* Increase adoption of `model::Binary::makeType`, equivalent to
`Binary.recordNewType(makeType<model::*Type>())`.
Before this commit, if there was a failure during the verification of a
type (which is recursive), we'd get an assertion in ~VerifyHelper due to
a "pending" type still being verified.