Commit Graph

115 Commits

Author SHA1 Message Date
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 57b5eb7f98 NameBuilder: allow different name checkers 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
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02: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 11d8515f46 ModelToHeader: adjust blank lines 2024-11-27 17:18:12 +01: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 4e670ac8e6 Either link revngcSupport or revngSupport 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
Alessandro Di Federico 36e2faad3d Introduce -Wunreachable-code-break 2024-10-31 17:19:55 +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 8aa7b55e2d PTMLIndentedOstream: rename into IndentedOstream 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
Alessandro Di Federico e1f46264f8 Ensure every pipe commits what it should 2024-09-26 17:51:07 +02:00
Ivan Krysak 77c8e4b927 PTML: move annotation data to a new header 2024-09-04 16:43:57 +02:00
Ivan Krysak 7b00b85647 PTMLCBuilder: introduce a code tag annotation 2024-09-04 13:04:44 +03:00
Ivan Krysak 2c9c780a3d PTMLCBuilder: introduce a _SIZE annotation 2024-09-04 13:04:44 +03:00
Ivan Krysak 4a080cae0c PTMLCBuilder: introduce a _START_AT annotation 2024-09-04 13:04:44 +03: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
Pietro Fezzardi 84a40d0239 TypeInlineHelper: clean up members and methods 2024-06-07 17:59:06 +02:00
Pietro Fezzardi d82255b3fa Don't inline pointer types
Support for them was subtly bugged in case of recursive types, and
properly supporting this is not trivial.
We disable them for now.
2024-06-07 17:59:06 +02:00
Pietro Fezzardi 7a38a257b9 Refactor TypeInlineHelper::findTypesToInline
This change is a preparation for further decoupling of the
TypeInlineHelper from its custom dependency graph type, to try and reuse
the DependencyGraph used in ModelToHeader.
2024-06-07 17:59:06 +02:00
Pietro Fezzardi e052dee40f Drop isCandidateForInline 2024-06-07 17:59:06 +02:00
Pietro Fezzardi a44679f847 ModelToPTMLTypeHelpers.cpp: fix unaligned Doxygen 2024-06-07 17:55:52 +02:00
Lauri Vasama e2f3f31093 Introduce RawFunctionType::Architecture 2024-05-29 15:43:35 +02:00
Pietro Fezzardi e1a59e527a TypeNames: fix missing trailing \n in PTML comment
The missing \n was causing following type declaration to be wrongly
commented out.
2024-05-29 15:34:26 +02:00
Pietro Fezzardi 2ee2577152 TypeInlineHelper: drop unused getTypeGraph method 2024-05-29 15:34:26 +02:00
Pietro Fezzardi 746cf5b55d TypeInlineHelper: rename collectStackTypes method
to collectTypesInlinableInStacks and document it.
2024-05-29 15:34:26 +02:00
Pietro Fezzardi df9d7215b5 TypeInlineHelper: remove unnecessary members
`TypeToNumOfRefs` was used only in one method, so it can be computed
directly there on the fly.

`calculateNumOfOccurrences` doesn't need to be a method (it can be a
free function), it doesn't need to run at construction time, and it
doesn't need to return a map. So it's been moved in the `.cpp` file,
renamed to `getCrossReferencedTypes` and changed to return a set. It is
now only called when needed.
2024-05-29 15:34:26 +02:00
Pietro Fezzardi 31db946bd3 TypeInlineHelper: refactor collectStackTypes
Now collectStackTypes is implemented as a wrapper on top of
findTypesToInlineInStacks.
2024-05-29 15:34:26 +02:00
Pietro Fezzardi 196a15685f Rename TypeInlineHelper::findStackTypesPerFunction
to TypeInlineHelper::findTypesToInlineInStacks, which is more
descriptive of what the method actually does.
2024-05-29 15:34:26 +02:00
Pietro Fezzardi f1fedf4e4e Drop unused TypeInlineHelper::getTypeToNumOfRefs 2024-05-29 15:34:26 +02:00
Pietro Fezzardi d9fddc4933 Early exit from isReachableFromRootType
Before this commit, TypeInlineHelper would always visit all the types to
compute reachability.
Now it bails out early, as soon as it detects reachability.
2024-05-29 15:34:26 +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