Before this commit, we did not take into consideration that
revng_call_stack_arguments has reference semantics, and we were using
its AddressOf in call sites that were taking the stack arguments.
This commit fixes the problem, bypassing the call to AddressOf when
passing the arguments to calls.
Before this commit, the code was assuming that we only passed stack
arguments to fuctions with RawFunction type. This is not true anymore.
This commit adds support to getStrongModelInfo for when we are passing
stack arguments to CABIFunctionType.
This commit handles the situation in which we have a call site with
stack arguments, but it was not possible to determine the stack height
at the call site.
The solution is to simply ignore stack arguments and emit in the IR a
warning.
This commit does the following:
- drops revngfloat.h
- disables printing primitive types in ModelToHeader
- creates a new header revng-primitive-types.h which includes all the
declarations of all revng primitive types
This commit introduces a `Kind` for arguments described in
`FunctionType::Layout`. We nowe basically have three types of arguments:
* Scalar: a regular scarlar argument;
* ReferenceToAggregate: a reference to an aggregete argument on the
stack;
* ShadowPointerToAggregateReturnValue: a pointer to the storage for the
(aggregate) return value allocated by the caller;
This commit completes the support of various rare PrimitiveTypes, that
has been added opportunistically over time and has remained inconsistent
across the codebase:
- float80_t
- float96_t
- generic80_t
- generic96_t
The first two are necessary because on some platforms long double is
either 10 or 12 bytes wide.
The second two are necessary because the Generic PrimitiveType should
allow all non-zero byte sizes allowed by any other PrimitiveType.
The architecture-specific pointer (generic register) size is used
instead.
For all the ABIs we support the value of this parameter was already
set to its pointer size. We might need to reintroduce the parameter
in the future if we want to support a super-exotic ABI with different
stack alignment requirements, but that seems highly unlikely.
This also introduces the argument extension helper for one stop all
treating small arguments when they are put into a register or pushed
into the stack.
FunctionMetadata was being deserialized every time they were
inspected. This commit introduces a cache structure to prevent this
excessive deserializations.
The actual ptml::attributes::LocationDefinition for arguments is already
generated when emitting the prototype of the functions.
The removed calls were just serializing the location definition once
more and disposing of it without serializing it anywhere.