Commit Graph

18 Commits

Author SHA1 Message Date
Ivan Krysak 66c96fb128 ABI: improve RegisterStateDeductions
Split the interface into two functions: `enforce.*` returning the map by
value and `tryApply.*` returning an `std::optional`.

Improve non-positional single deduction function to better reflect
some corner cases (for example how a required `NoOrDead` register
argument is handled).

Enforce a position-based deduction corner case where it's impossible to
deduce whether the argument is passed in the GPR or the vector one -
now GPR takes precedence in those cases.
2022-04-15 18:25:11 +02:00
Pietro Fezzardi e40ded965f QualifiedType RawFunctionType.StackArgumentsType
The `StackArgumentsType` field of `RawFunctionType` was the only
cross-reference between `model::Type`s that did not use
`model::QualifiedType` but a naked `TupleTreeReference`.

Switching it to `QualifiedType` make all cross-references across
`model::Type`s homogeneous.
2022-04-08 18:58:58 +02:00
Ivan Krysak a10415fd0b Make the function layout argument type aware 2022-03-28 15:43:34 +02:00
Ivan Krysak 1b03adca5e Make function type convertions self-sufficient 2022-03-28 15:38:04 +02:00
Ivan Krysak f614a8cf7f Implement ABI SystemV_x86_64 stack support 2022-03-28 15:38:04 +02:00
Ivan Krysak ad7f47700a Rework how function type convertion handles names 2022-03-28 15:37:59 +02:00
Ivan Krysak 20bb0a2b90 Fix some minor abi::FunctionType issues 2022-03-28 15:37:59 +02:00
Ivan Krysak 326624f517 Fix TupleTreeCompatible linkage problem
Now all the generated `.cpp` include `Binary.h`. This ensures we don't
trigger the wrong concept due to forward declarations.

Also, this commit introduces a couple of `static_assert`s which should
enable us to early identification of similar problems.
2022-03-28 15:33:30 +02:00
Alessandro Di Federico 2b55d1df22 Adopt cmake-format 2022-03-17 18:52:18 +01:00
Alessandro Di Federico ea6383c476 mv {d,registerD}efaultFunctionPrototype 2022-03-17 14:10:50 +01:00
Alessandro Di Federico bc8e6a6a24 Minor changes 2022-03-16 22:10:15 +01:00
Ivan Krysak bc0e6d1392 ABI: preliminary FinalStackOffset computation 2022-02-25 00:32:24 +01:00
Ivan Krysak 2c35fc87d5 Conversion to RawFunctionType cannot fail 2022-02-25 00:31:14 +01:00
Ivan Krysak 11989b316b Ensure model is untouched RawToCABI
It's now guaranteed to leave the model unmodified if the converstion
from `RawFunctionType` to `CABIFunctionType` fails.
2022-02-25 00:30:51 +01:00
Ivan Krysak b14fee7515 Implement abi::FunctionType::layout()
The `Layout` data structure works as a common view over
`RawFunctionType` and `CABIFunctionType`.
2022-02-25 00:30:14 +01:00
Ivan Krysak 541643afc3 Move function type conversion to librevngABI 2022-02-24 23:56:30 +01:00
Ivan Krysak 371f5c4555 Implement ABI-based register state deductions
This will help EarlyFunctionAnalysis in providing more accurate results,
in case assumptions about the ABI can be made.
2022-02-14 13:35:37 +01:00
Ivan Krysak cafe44097b ABI: introduce default function type generation 2022-02-14 13:35:37 +01:00