Ivan Krysak
f6970ff70a
TypeNames: fix function prototype return value tag
2025-07-23 11:38:53 +02:00
Ivan Krysak
97aa3c8247
std::string: use implicit default constructor
2025-07-23 11:38:53 +02:00
Ivan Krysak
290d2e2c57
ptml::CTypeBuilder: rename into ModelCBuilder
2025-07-23 11:38:53 +02:00
Ivan Krysak
21734cad34
CTypeBuilder: add new variable and label tagging
2025-07-23 11:38:51 +02:00
Lauri Vasama
28550f2f57
Add explicit pointer size support in old backend
...
When `Configuration.ExplicitTargetPointerSize` is set, the backend uses
explicit pointer type sizes (e.g. `pointer32_t(T)`).
2025-07-17 16:45:03 +02:00
Pietro Fezzardi
0426c773b2
CABIFunctionDefinition: drop array argument/return
...
This commit bans from the model array types in as argument or return
types in CABIFunctionDefinition.
CABIFunctionDefinition implies we're decompiling towards C, and C does
not support array arguments (passed by copy) nor array return types.
Banning these from the model reduces the number of situations where we
have to emit artificial array wrappers (not present in the model) around
types when printing C code, simplifying the handling of such situations
when translating to clift and in general in the decompilation pipeline.
2025-05-28 17:11:11 +02:00
Ivan Krysak
c7bba8c1b9
Prevent Support headers from depending on PTML
2025-05-08 15:42:01 +02:00
Ivan Krysak
0b2461e7b3
Wrap comments into a tag that allows commenting
...
This wraps most of the comments into a tag that lets them be edited
as they are, without needing to find where that comment is actually
attached to.
2025-05-08 15:42:01 +02:00
Ivan Krysak
f25ea78aa8
PTMLCTypeBuilder: separate RFT-RV wrapper emission
...
This lets us drop the ability for the `getNamedInstanceOfReturnType`
to return definitions (this was the only user).
2025-05-08 15:42:01 +02:00
Ivan Krysak
0a097c067b
TypeNames: suppress selected comment newlines
2025-05-08 15:42:01 +02:00
Ivan Krysak
6d2b3169d8
TypeNames: render segment comment
2025-05-08 15:42:01 +02:00
Ivan Krysak
6cdf5c01ef
PTML: make commentability a property of a line
...
Before this, commenting is only possible on specific names, with this
the entire supported line is active (unless there are more grannular
comment contexts, for example, in the function prototype).
For example (commentable parts are marked with `^`):
```
// struct whatever {
// ...
// before this
const my_type_name *my_field_name[10];
// ^^^^^^^^^^^^^
// after this
const my_type_name *my_field_name[10];
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// ...
// };
```
It's the same for all the others, like segments, arguments, and so on.
2025-05-08 15:42:00 +02:00
Ivan Krysak
eac296a99f
Standardize PTML tag emission in c backend
2025-05-08 15:42:00 +02:00
Ivan Krysak
fa2f243f12
PTML: avoid auto in constexpr string literals
2025-05-08 15:42:00 +02:00
Giacomo Vercesi
4e7469c1eb
ModelTypeNames: fix context-action
...
The `data-action-context-location` applies to only the variable portion
of a function argument, not the type and the variable.
2025-05-05 17:28:48 +02:00
Ivan Krysak
c6e38cd485
Return to using constant name builders
...
Because of how name builders used to lazy gather namespaces on the first
requested name, the objects were self mutating. As such only non-const
references could be used to pass them around.
Since that is no longer the case, this restores most of lost const
qualifiers.
2025-04-17 11:19:17 +03:00
Ivan Krysak
dce5c1a02c
NamingConfiguration: pull more prefixes inside
...
Unify additional values that used to be hardcoded in the old backend
under the same naming configuration root.
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
Pietro Fezzardi
142428c9a1
TypeNames: assert no CABIFT returns a RegisterSet
...
This assertion mirrors the equivalent set of assertions on RFT, that
never return ModelAggregate.
2025-01-29 15:17:15 +01:00
Lauri Vasama
bda55aac19
Add Clift C Backend
2025-01-10 08:04:20 +02:00
Lauri Vasama
03ef33f65c
Add function location reference functions
2025-01-02 11:25:32 +02:00
Alessandro Di Federico
143c315196
Merge revng-c into revng
2024-11-21 10:50:55 +01:00
Ivan Krysak
4582982075
Replace std::string_view with llvm::StringRef
2024-11-06 19:18:53 +02:00
Ivan Krysak
64446d0453
Adopt name builder across the model users
2024-11-06 19:18:53 +02:00
Alessandro Di Federico
98903f6b07
Move Ranks.h to revng
2024-11-04 15:09:56 +01:00
Alessandro Di Federico
2e4f4d09b9
Remaining FunctionTags have been moved to revng
2024-11-04 15:09:56 +01:00
Ivan Krysak
63a3c9cec0
PTML: move location creation to the type builder
2024-10-15 10:45:13 +03:00
Ivan Krysak
1a35cbcb77
Introduce PTMLCTypeBuilder
2024-10-15 10:45:13 +03:00
Ivan Krysak
f523edc863
Pipeline: toString -> locationString
2024-10-15 09:13:28 +02:00
Ivan Krysak
8288bd68d2
PTMLCBuilder: rename into ptml::CBuilder
2024-10-15 09:13:28 +02:00
Alessandro Di Federico
ca99bbbb66
Adopt toString()
2024-09-26 17:51:08 +02:00
Ivan Krysak
77c8e4b927
PTML: move annotation data to a new header
2024-09-04 16:43:57 +02:00
Ivan Krysak
cae04be8fd
PTMLCBuilder: clean up annotation method naming
2024-09-04 13:04:44 +03:00
Ivan Krysak
94a0ad6b93
Adopt reworked model::Type
2024-06-27 11:07:01 +02:00
Ivan Krysak
3705906074
Model: rename Type into TypeDefinition
2024-06-27 11:07:01 +02:00
Lauri Vasama
e2f3f31093
Introduce RawFunctionType::Architecture
2024-05-29 15:43:35 +02:00
Alessandro Di Federico
0c212b66d9
Relicense to MIT
2024-02-29 17:03:36 +01:00
Alessandro Di Federico
2de10213d4
Segregate: improve returning aggregates support
...
This commit heavily reworks how we handle returned values, making things
a bit more elegant.
Apart from this, it fixes how were handling types that on the model are
aggregates but were being returned via registers on the IR.
2023-12-12 12:04:21 +01:00
Alessandro Di Federico
d5ad77d2d9
Adopt model::QualifiedType::stripPointer
2023-12-12 12:04:19 +01:00
Alessandro Di Federico
c561a71089
s/Layout::returnsAggregateType/Layout::hasSPTAR/
2023-12-12 12:04:12 +01:00
Giacomo Vercesi
194bcecc41
Drop getReturnField
...
Drop the `getReturnField` helper, the cases in which it was used are now
covered by the `NamedTypeRegister::name` method.
2023-12-11 10:21:40 +01:00
Giacomo Vercesi
fd24487666
C code: fix location for RawFunction return struct
...
Fix the needed attributes to allow navigation from the use of an
artificial return struct for raw functions to their definition in
`types-and-globals.h`.
2023-12-11 10:21:40 +01:00
Pietro Fezzardi
24cb43ce9c
Make RawFunctionType::StackArgumentsType a TTR
...
This is homogeneous with all other nullable references to types in the
model, such as the StackFrameType in model::Function, and others.
2023-12-05 16:56:52 +01:00
Giacomo Vercesi
68f71c3b39
Adopt new PTML tags
...
Change the emitted decompile code to include the
`data-action-context-location` and `data-name-of` tags.
2023-11-03 16:31:06 +01:00
Giacomo Vercesi
0ca3c03de1
ModelTypeNames: fix printFunctionPrototype
...
The `printFunctionPrototype` function produced a prototype with a
`data-location-references` instead of a `data-location-definition`.
2023-10-23 10:20:54 +02:00
Giacomo Vercesi
df877d4aec
Drop unused statements
...
Drop `using`s that were unused.
2023-10-23 10:20:49 +02:00
Pietro Fezzardi
4bc7a14649
ModelTypeNames: print function attributes
2023-10-18 15:39:17 +02:00
Alessandro Di Federico
2a7e06df1f
printFunctionPrototype: add newline after ABI
...
This commit forces getLocationAttribute's argument to be false.
2023-10-06 17:14:29 +02:00
Alessandro Di Federico
f3d6bbb047
s/ThePTMLCBuilder/B/g
2023-08-23 16:40:54 +02:00