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.
I found that it leads to better looking code when the check of whether
the range in question even has enough elements to skip is inside
the helper.
As such a separate type of skip entry point was introduced: one that
allows to iterate over the container pairwise
Now, instead of asserting, the loop just does nothing in cases like
```cpp
for (const auto &Element : zip_pairs(make_empty_range())
do_stuff();
```
Under certain conditions, upon import, functions where not being added
`ExportedNames`, which was preventing them from finding the prototypes
from dynamic libraries' debug information.
This commit ensure the BaseAddress is propagate as appropriate to all
levels of the importers and that it is ignored for executables
(non-PIC).
This was a recurring source of importing the same function twice, once
relocated, once not.
The algorithm was looking for any array qualifier on a zero-sized
type, which led to some valid types being discarded in the case
when there was a pointer qualifier in-between.
`void a[100]` is not a valid type, while void *a[100]` is.