Alignment considerations all over the place where growing increasingly
verbose and complex, increasing the likelihood of getting them wrong.
This unifies all the alignment logic in one place.
There were issues with how trailing padding is processed which sometimes
led to it being discarded. That should not happen from now on.
As a size benefit this also strictens the exit condition and improves
wording on some of the comments.
Some ABI's (think mips) require a part of the stack to be reserved,
but before this patch we treated those fields as arguments.
Note that this analysis never inserts fields, so if there are no
sufficient field already inserted before-hand it's just going to fail
the conversion (for example, if the field at the *newly adjusted*
offset 0 is not present).
For now, the only serialization trait we were verifying
a polymorphic TTG type to have was the wrong (the one
that only printed base class's fields).
This commit explicitly disables said serializer and
ensures it's never used.
Here's an illustration of the impact of the changes:
```
model::UpcastableType MyType = getTypeFromSomewhere();
model::Type &View = *MyType;
model::PointerType &Pointer = MyType->asPointer();
serialize(MyType); // Good
serialize(Pointer); // Good
serialize(View); // new: explicit error
// old: only print base type's fields
```
It was still broken, even after `feature/alignment-fixes`, so
this commit softens requirements even further, to allow some of
the desired cases to pass through the verifier.
This lets us drop the repeated alignment calculations at
the "leaves" of the conversion. Since new distributor already
provides the necessary information, we can just grab it from
there.
Before this, padding was just handled as a part of the size, but that
made it unnecessarily hard to work with. Now, everything padding-related
is extremely explicit.