Commit Graph

30 Commits

Author SHA1 Message Date
Pietro Fezzardi 8de85c25a0 Remove array field of opaque struct types 2026-05-13 08:51:25 +02:00
Pietro Fezzardi 21063f1844 NameBuilder: support opaque types
Teach NameBuilder and ModelCBuilder how to produce names and
references for opaque-array types: NameBuilder gains
opaqueTypeName(ByteSize), ModelCBuilder gains the matching
reference and definition tags. Both rely on the new
Configuration::OpaqueTypePrefix.
2026-05-08 11:37:10 +02:00
Ivan Krysak 1c56e34350 NameBuilder: introduce isAutomaticName 2026-02-25 14:10:44 +01:00
Lauri Vasama 4c5544816a Enable explicit automatic naming for locals 2026-02-13 08:41:39 +02:00
Lauri Vasama 6947a31a0c Add stack frame variable automatic naming 2026-02-13 08:41:39 +02:00
Alessandro Di Federico ce4f6ef996 llvmName: turn into a free function 2025-12-22 11:34:46 +01:00
Alessandro Di Federico a1f9bd2d16 Minor changes 2025-12-22 11:34:46 +01:00
Ivan Krysak ecb9d76c64 Model: drop obsolete default value handling 2025-10-13 18:33:10 +03:00
Giacomo Vercesi eba55456f6 NameBuilder: fix a use-after-free bug 2025-09-08 16:33:51 +02:00
Ivan Krysak c80309088a NameBuilder: add shouldUseAutomaticName method
It provides a way to dynamically check whether a custom name is
going to be emitted for a specific entity or not.
2025-09-04 16:57:16 +03:00
Ivan Krysak 21734cad34 CTypeBuilder: add new variable and label tagging 2025-07-23 11:38:51 +02:00
Ivan Krysak 4265644adf NameBuilder: introduce counting sub-builders 2025-07-23 11:38:51 +02:00
Lauri Vasama a7eb86174b Add revng/Support/Identifier.h for id validation 2025-06-04 15:13:47 +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
Pietro Fezzardi b106024a13 NameBuilder: fix artificialArrayWrapperNameImpl
This commit fixes a copy-paste error that unfortunately did not lead to
compilation errors, but caused null pointer dereference every time the
method was called with a model::PointerType or model::PrimitiveType
argument.
2025-05-14 10:15:14 +02:00
Ivan Krysak 17a5d19135 NameBuilder: add name overload for primitives 2025-05-08 15:42:00 +02:00
Ivan Krysak 1622bb91a1 Introduce automatic names for dynamic functions 2025-04-24 13:22:14 +02:00
Ivan Krysak 79964eac74 Avoid ' misuse in error messages and comments 2025-04-17 16:41:21 +02:00
Ivan Krysak 83324fcf07 NameBuilder: improve documentation 2025-04-17 11:19:17 +03: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 57b5eb7f98 NameBuilder: allow different name checkers 2025-04-17 11:19:17 +03:00
Ivan Krysak c9ade8d458 NameBuilder: report reason when renaming something 2025-04-17 11:19:17 +03:00
Ivan Krysak 57ac85d7a0 NameBuilder: introduce warning method 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 25790b5a78 NameBuilder: change automatic segment name
Use index within the binary instead of address in order to make these
shorter.
2025-04-15 16:35:42 +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 6ea75f02b3 Model: switch to the new namespace verifier 2025-04-15 16:35:42 +03:00
Ivan Krysak 288448f009 Never include model::VerifyHelper from headers 2025-02-13 13:09:50 +02:00
Ivan Krysak 672ee5df50 Replace std::string_view with llvm::StringRef 2024-11-06 15:43:13 +02:00
Ivan Krysak ad868f57ad Model: introduce name builder 2024-11-06 15:43:13 +02:00