Commit Graph

105 Commits

Author SHA1 Message Date
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
Giacomo Vercesi 4d83c5e879 Allow renaming RawFunctionType return fields
Add the needed attributes to allow the fields of the return of a
RawFunctionType to be renamed.
2023-12-11 12:03:48 +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 ce446576a4 Fix typos 2023-11-02 16:49:49 +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
Pietro Fezzardi 740ef6f1d3 ModelToPTMLTypeHelpers: avoid redundant whitespace
Before this commit, the `printDefinition` helper functions for
`StructType` and `UnionType` were printing a duplicated whitespace when
generating the inline type definition as part of the declaration of a
field of a struct or union.

This commit skips the redundant whitespace when relevant.
2023-10-18 15:19:53 +02:00