Ivan Krysak
15f8999fce
ABI-testing: simplify compatibility checker
...
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.
2023-03-15 10:19:03 +01:00
Ivan Krysak
2dfe65f65c
ABI: purge unnamed types when analyses are done
2023-03-15 10:19:03 +01:00
Ivan Krysak
17c128c59b
Make ABI depend on ModelPasses
...
Before now the dependency was the other way around
2023-03-15 10:19:03 +01:00
Ivan Krysak
4d21a88777
Model: remove an obsolete function conversion pass
2023-03-15 10:19:03 +01:00
Ivan Krysak
f068bcb34f
ABI-testing: switch to the new analyses
2023-03-15 10:19:03 +01:00
Ivan Krysak
158272dee5
ABI: add an analysis for ToCABI conversion
2023-03-15 10:19:03 +01:00
Ivan Krysak
952b938598
ABI: add an analysis for ToRaw conversion
2023-03-15 10:19:03 +01:00
Ivan Krysak
fba30712cc
ABI: introduce abi::FunctionType::filterTypes
2023-03-15 10:19:03 +01:00
Ivan Krysak
3d05439001
ABI: improve multi-aligned stack argument support
2023-03-15 10:19:03 +01:00
Ivan Krysak
3edfaa827f
ABI: preserve big scalar return values if possible
2023-03-15 10:19:03 +01:00
Ivan Krysak
a936990c77
ABI: abstract stack alignment verification away
2023-03-15 10:19:03 +01:00
Ivan Krysak
806d4053a0
ABI: reintroduce conversion logs
2023-03-15 10:19:03 +01:00
Ivan Krysak
09f1d5b5e7
ABI: rework stack argument conversion
2023-03-15 10:19:03 +01:00
Ivan Krysak
ea6148e616
DetectABI: leave a todo on droping RS deductions
2023-03-15 10:19:03 +01:00
Ivan Krysak
a0adafeab0
ABI: take advantage of register state deductions
...
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.
2023-03-15 10:19:03 +01:00
Ivan Krysak
0c82ff91b1
ABI: move the conversion ouside the helper class
...
This will allow reusing the helper class as the type manager.
2023-03-15 10:19:03 +01:00
Ivan Krysak
3422a9bf0f
ABI: reintoduce conversion logs
2023-03-15 10:19:03 +01:00
Ivan Krysak
b966637373
Layout: improve shadow return value handling
...
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.
2023-03-15 10:19:03 +01:00
Ivan Krysak
a093d166b1
ABI: revamp basic floating point argument handling
...
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.
2023-03-15 10:19:03 +01:00
Ivan Krysak
9f7427c776
ABI: fix desynchronization of argument indices
...
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.
2023-03-15 10:19:03 +01:00
Ivan Krysak
f7be81737b
ToRawConverter: don't attempt to recover types
2023-03-15 10:19:03 +01:00
Ivan Krysak
5bf13ac420
ABI: restructure ToRaw conversion root
...
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.
2023-03-15 10:19:02 +01:00
Ivan Krysak
1d1003b7e5
ABI: introduce TypeBucket helper
2023-03-15 10:19:02 +01:00
Ivan Krysak
8a1d62728d
ABI: remove constexpr abi trait
2023-03-15 10:19:02 +01:00
Ivan Krysak
4ecb88ab9d
ABI: move ToCABIConverter onto the runtime trait
2023-03-15 10:19:02 +01:00
Ivan Krysak
51beb8fc1b
ABI: move ToRawConverter onto the runtime trait
2023-03-15 10:19:02 +01:00
Ivan Krysak
30b9234a04
abi::Definition: introduce a padding helper
2023-03-15 10:19:02 +01:00
Ivan Krysak
59d3b627a1
ABI: simplify default prototype stack traces
2023-03-15 10:19:02 +01:00
Ivan Krysak
039de1fe6d
ABI: move function prototype onto the runtime trait
2023-03-15 10:19:02 +01:00
Ivan Krysak
89b3def533
ABI: move RegisterOrder onto the runtime trait
2023-03-15 10:19:02 +01:00
Ivan Krysak
9e393578c9
ABI: move state deduction onto the runtime trait
2023-03-15 10:19:02 +01:00
Ivan Krysak
ce0d39a9a6
Model: document model::Type::size()
2023-03-15 10:19:02 +01:00
Ivan Krysak
b19572ea67
Model: Leave a note about the alignment
2023-03-15 10:19:02 +01:00
Ivan Krysak
84229d92b1
Model & ABI: make size and alignment stricter
2023-03-15 10:19:02 +01:00
Ivan Krysak
769e5c1cbe
ABI: add a natural alignment calculation helper
2023-03-15 10:19:02 +01:00
Ivan Krysak
6fc300d6d4
ABI: forbid using XMM registers to return values
...
This should be reverted once the vector register support is introduced
2023-03-15 10:19:02 +01:00
Ivan Krysak
8b675e131e
ABI: introduce runtime abi definition
2023-03-15 10:19:02 +01:00
Ivan Krysak
58b33ea7af
ABI-testing: make rtf-equivalence id-independent
2023-03-15 10:19:02 +01:00
Ivan Krysak
7daa187107
ABI-testing: support returning values as a pointer
2023-03-15 10:19:02 +01:00
Ivan Krysak
ad0fc079b8
ABI-testing: rename verify-abi
...
The new name is `check-compatibility-with-abi`
2023-03-15 10:19:02 +01:00
Ivan Krysak
f4cbbaa365
ABI-testing: remove an extra tag redefinition
2023-03-15 10:19:02 +01:00
Ivan Krysak
87bded80d3
ABI: rename RegisterList into RegisterVector
2023-03-15 10:19:02 +01:00
Ivan Krysak
3d3348b84a
ABI: rename Converter into ToCABIConverter
...
This also moves members definitions outside the class boundaries
2023-03-15 10:19:02 +01:00
Ivan Krysak
b1b9453585
ABI: rename Converter into ToRawConverter
...
This also moves members definitions outside the class boundaries
2023-03-15 10:19:02 +01:00
Ivan Krysak
0e8aee95e9
ABI: rename ArgumentContainer into ArgumentSet
2023-03-15 10:19:02 +01:00
Ivan Krysak
395191cdf1
ABI: use replaceReferencesIf when updating types
2023-03-15 10:19:02 +01:00
Ivan Krysak
bcca3ac8b7
TupleTree: introduce replaceReferencesIf
2023-03-15 10:19:02 +01:00
Ivan Krysak
9eb55f363b
STLExtras: introduce some c++20 invocable concepts
2023-03-15 10:19:02 +01:00
Ivan Krysak
01a05e2037
ABI: separate convertions based on the direction
2023-03-15 10:19:02 +01:00
Ivan Krysak
2f3128cb43
ABI: separate reused helpers into Support.h
2023-03-15 10:19:02 +01:00