Commit Graph

187 Commits

Author SHA1 Message Date
Khaled Ismaeel 531d9b866c Remove the now-redundant HEADERS list 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 63469c9cd6 Use unified YAML schemas in the build process
In this commit we instruct the build system to use the unified schema
files  instead of collecting the `TUPLE-TREE-YAML` comments.

The fixes to C++ files are necessary because they depend on the order
of the fields in the schema, which was changed.
2025-04-30 15:08:45 +02:00
Ivan Krysak 79964eac74 Avoid ' misuse in error messages and comments 2025-04-17 16:41:21 +02:00
Ivan Krysak 57b5eb7f98 NameBuilder: allow different name checkers 2025-04-17 11:19:17 +03:00
Ivan Krysak f070f1f1e1 Model: sunset double name system 2025-04-17 11:19:17 +03:00
Ivan Krysak 645cf7fc2e NameBuilder: sunset deduplication
This reworks NameBuilder to ease the transition to the system where
the model will be guaranteed to never contain any name collisions, both
between user-specified names and the automatic ones.
2025-04-15 16:35:42 +03:00
Ivan Krysak 3edb6cbb9b Minor improvements 2025-04-15 16:35:42 +03:00
Ivan Krysak 48b6ab7597 ABI: fix a rare crash on a misaligned argument 2025-03-05 08:57:35 +02:00
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak f494ae5f5f Standardize comment formatting
Use `*something*` instead of `_something_` when adding emphasis.
2025-02-13 13:09:50 +02:00
Ivan Krysak d4ab801ab7 Rename range_with_value_type into RangeOf
Original name was reminiscent of the STL, but there's no such concept
in there, as such it's probably better to use revng naming convention
instead.
2025-02-13 13:09:50 +02:00
Ivan Krysak a93ffd3760 Rename UnusedStackArgumentBytes
Old name was `StackBytesAllocatedForRegisterArguments`.
2025-02-12 16:43:19 +02:00
Ivan Krysak 9bb71627ea ToCABI: do basic float detection cleanup
Note that this whole thing is going to get redesigned from scratch
(by manifesting a proper type system graph) when we'll finally start
working on the *real* float support.
2025-02-12 16:43:11 +02:00
Ivan Krysak e4d9a022cd ToCABI: factor alignment computation out
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.
2025-02-12 16:43:05 +02:00
Ivan Krysak a5a2bead4f ABI: fix success detection and trailing padding
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.
2025-02-12 16:40:59 +02:00
Ivan Krysak 7ad6b52974 ABI: improve distributor safety
This makes sure we never try to use a distributor object after
discarding some of its outputs.
2025-02-12 16:36:20 +02:00
Ivan Krysak ab535feb13 ABI: always use distributor for index selection 2025-02-12 16:36:20 +02:00
Ivan Krysak 8e85515969 ABI: fix mishandling of the top of the stack
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).
2025-02-12 16:36:20 +02:00
Ivan Krysak 566cbad8ae ToCABI: switch argument verification pair
Before this, arguments were verified in a (current, next) pair,
this makes it so (previous, next) pair is used instead.
2025-02-12 16:36:20 +02:00
Ivan Krysak c861e1c552 ToCABI: bundle argument-specific data together 2025-02-12 16:36:20 +02:00
Ivan Krysak 2521ffc1be ABI: allow ValueDistributor reassignment 2025-02-12 16:36:20 +02:00
Ivan Krysak 69144a7e3b ToCABI: improve function name logging 2025-02-12 16:36:18 +02:00
Ivan Krysak 492c169217 ToCABI: mark AAPCS64 as a safe ABI 2025-02-12 16:26:56 +02:00
Ivan Krysak 9186d476d2 ToCABI: fix mistreating of the safe cli argument 2025-02-12 16:26:56 +02:00
Ivan Krysak 850677115e Minor improvements 2025-02-12 16:26:56 +02:00
Alessandro Di Federico 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +01:00
Ivan Krysak 672ee5df50 Replace std::string_view with llvm::StringRef 2024-11-06 15:43:13 +02:00
Ivan Krysak a67ba96644 Adopt name builder across the model users 2024-11-06 15:43:13 +02:00
Ivan Krysak 724f8bfb59 ABI: streamline terminology
"packed" is used instead of "unnaturally aligned".
2024-10-08 13:53:53 +02:00
Ivan Krysak 4bdc7f83b5 ABI: drop incomplete pascal support 2024-10-08 13:53:53 +02:00
Ivan Krysak 5150fbd8c8 ABI: Limit usage of the StackAlignment option 2024-10-08 13:53:53 +02:00
Ivan Krysak 659bd01974 ABI: make distribution carry alignment information
This allows argument distribution to change based on the previous
argument by only preserving alignment information.
2024-10-08 13:53:53 +02:00
Ivan Krysak 85474eb228 ABI: let last argument distribution differ 2024-10-08 13:53:52 +02:00
Ivan Krysak 7dfd669bde ABI: introduce a new configuration option:
`StackArgumentsUseRegularStructAlignmentRules`.
2024-10-08 13:53:52 +02:00
Ivan Krysak b378ac9b17 ABI: improve handling of padding arguments 2024-10-08 13:53:52 +02:00
Ivan Krysak 1289678457 ABI: fix AArch64 pointer-to-copy handling 2024-10-08 13:53:52 +02:00
Ivan Krysak d314c6ca36 ABI: fix a bug related to argument splitting 2024-10-08 13:53:52 +02:00
Ivan Krysak e4d8ead973 ABI: make MinimumStackArgumentSize explicit 2024-10-08 13:53:52 +02:00
Ivan Krysak d6ca06b864 ABI: handle SPTAR return value register correctly 2024-10-08 13:53:51 +02:00
Alessandro Di Federico 2cdedc71f4 s/serialize/toString/
We keep serialize for method dealing with streams.
If it returns a `std::string`, let's use `toString`.
2024-09-27 12:07:17 +02:00
Alessandro Di Federico 850276f5c8 Minor changes 2024-09-27 12:07:16 +02:00
Alessandro Di Federico b69c5d2b99 ConvertToCABI: ignore DefaultPrototype 2024-08-16 16:33:39 +02:00
Ivan Krysak 336fac0a67 ABI: do not assert when offset is not aligned
Abort the conversion instead.
2024-08-06 10:26:34 +02:00
Ivan Krysak 4a2db0ba4f UpcastablePointer: streamline empty behavior 2024-06-27 11:05:52 +02:00
Ivan Krysak 823e561806 TTG: rework polymorphic serialization
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
```
2024-06-27 11:05:51 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak 925690a1e1 VerifyHelper: reduce pointer usage 2024-06-27 11:05:50 +02:00
Ivan Krysak 927e8006b9 Model: rename TypePath to DefinitionReference 2024-06-27 11:05:49 +02:00
Ivan Krysak ac587cbb4f Model: rename Type into TypeDefinition 2024-06-27 11:05:48 +02:00
Ivan Krysak 84c8822c37 Model: drop TypedRegister 2024-06-27 11:05:48 +02:00