This reevaluates the places where `std::size_t` should be replaced by
`std::uint64_t` in the conversions, it also appends `std::` prefixes to
them where it's possible in preparation to the eventual `import std`
transition.
Because it's often hard to predict the specific location of an argument when
non-natural alignment is concerned, this adds an extra check allowing
the cases to pass if they would be well-formed if only some pesky
"extra" bytes were to disappear.
Since dwarf sometimes misdetects abi pretty badly, to maintain
the usefulness of the test, it's beneficial to sometimes discard
the "detected" ABI by overriding it by the known value.
This also add a check ensuring that all the functions presents in
the artifact are also present in the binary.
The original non-position based distribution (`considerRegisters`)
algorithm had a whole lot of problems preventing effective padding
support because it was written with only registers in mind.
As such, it was easier to rewrite the whole logic from scratch over
trying to fix it incrementally.
The new option is `NoRegisterArgumentsCanComeAfterStackOnes`
If it's set to `true`, then no register argument can follow any stack
argument under the said abi, otherwise such "shuffling" of arguments
is allowed.
The complicated error handling logic turned out to be more of
a nuisance than a useful debugging tool. This commit removes it
in favour of `revng_abort`'ing or `revng_check`'ing to make sure
the actual state is consistent with the expectations.
It also adds namespace to `std::size_t` mentions.
This makes the conversions more robust, since everything can rely on
the same tools for filling in missing registers and ordering them based
on the ABI requirements.
This brings the layout-side handling of these closer to the way they are
handled when converting the function.
The biggest change is the fact that now the return value location can
also be passed as the first stack argument.
This was a necessary change because without at least basic shortcuts
introduced here, we get a whole lot of failures downstream due to
layouts of such functions and the layout production is by design not
allowed to fail.
When a shadow return value location argument is distributed, it is
shifting all the other argument indices by one. This was not taken into
the account previously. This commit fixes the indices.
It also makes it so the arguments `SizeOnStack` does not account for
padding. This is useful for some layout users.
This reorders the algorithms, so that the return values are handled
before the arguments. It also improves the wordind and extends
the comments annotating the function.
Moreover, it takes advantage of the `TypeBucket` to decouple type
management from the "raw" binary.