3016 Commits

Author SHA1 Message Date
Giacomo Vercesi b40fec2270 Add LLMRename analysis to pypeline 2026-03-31 17:00:48 +02:00
Giacomo Vercesi 63a11d0c63 pypeline: add Analysis.is_available
Add a method to the `Analysis` interface which allows an analysis to
report if it is available for execution.
2026-03-31 17:00:48 +02:00
Ivan Krysak c354642902 Clifter: fix a newly introduced bug
This fixes the invalidation problem introduced by reading attributes
in the scope whose execution order depends on the function processing
order.
2026-03-27 12:27:26 +00:00
Ivan Krysak 6f02461948 Clift: fix missed getAttributes methods
They are now correctly named `getCAttributes`.
2026-03-27 12:27:16 +00:00
Ivan Krysak 5ca78e8897 emitCAttributes: improve spacing control 2026-03-27 08:27:23 +00:00
Ivan Krysak 9de53e434d CAttributes: introduce _NORETURN 2026-03-27 08:24:10 +00:00
Ivan Krysak 446e8cb88d CAttributes: introduce _ALWAYS_INLINE 2026-03-27 08:23:31 +00:00
Ivan Krysak fad05621cc CAttributes: drop IsReal property 2026-03-27 08:22:52 +00:00
Ivan Krysak 378bfb650f CliftEmitC: Attributes -> CAttributes 2026-03-27 08:22:23 +00:00
Ivan Krysak 754cfd57fe Model: introduce migration to version 9 2026-03-27 08:19:21 +00:00
Ivan Krysak de31315cd7 Model: rename Inline into AlwaysInline 2026-03-27 08:16:21 +00:00
Ivan Krysak 19741a32ab ImportModel: expose a high level type importer 2026-03-27 08:15:23 +00:00
Ivan Krysak b632772cbb ImportModel: import function attributes 2026-03-27 08:12:51 +00:00
Ivan Krysak 00f05cac7a ImportModel: introduce importSegmentDeclaration 2026-03-27 08:12:17 +00:00
Ivan Krysak 8f89984f36 ImportModel: introduce importFunctionDeclaration 2026-03-27 08:11:11 +00:00
Ivan Krysak c30f309f5e Clift: introduce getMutableComment 2026-03-27 08:09:09 +00:00
Ivan Krysak e34fbcb955 FunctionOp: add noreturn and always_inline 2026-03-27 08:08:08 +00:00
Ivan Krysak 318681cd42 Introduce TypeDependencyGraph 2026-03-27 08:05:10 +00:00
Ivan Krysak 1c14ae1c93 Introduce: CAttributeListBuilder 2026-03-27 07:19:27 +00:00
Ivan Krysak 729b025de3 CAttributes.h: move back to PTML
When `revng` and `revng-c` were being merged, this header founds its
way into `revngSupport` even though it makes more sense under the PTML
umbrella.
2026-03-27 07:19:27 +00:00
Ivan Krysak e706628a49 Rename Annotations.h into CAttributes.h 2026-03-27 07:19:27 +00:00
Ivan Krysak 7f66f25253 mlir::clift::ClassAttr: add attribute support 2026-03-27 07:19:27 +00:00
Ivan Krysak 928bcdb118 mlir::clift::FunctionType: add attribute support 2026-03-27 07:19:27 +00:00
Ivan Krysak 8a3a2082b5 CAttributeAttr: enforce argument types 2026-03-27 07:19:27 +00:00
Ivan Krysak f4e7d50361 Allow C-Attributes to accept integers and types 2026-03-27 07:18:49 +00:00
Lauri Vasama ad6f6df04e Improve function arg/result attribute interface 2026-03-27 07:18:49 +00:00
Ivan Krysak cdc633e31d CliftPipes: drop Pipe from filenames
This removes unnecessary Pipe from filenames which the directory name
already contains.

This also renames some of them to match the *new* pipeline.
2026-03-27 07:18:49 +00:00
Ivan Krysak 278b898793 llvm-to-clift -> clifter 2026-03-27 07:05:44 +00:00
Ivan Krysak addfc543c8 import-model-names -> import-descriptive-info 2026-03-26 16:28:48 +00:00
Ivan Krysak 6dc6ad2cf3 importModelTypes -> importTypes 2026-03-26 16:28:48 +00:00
Ivan Krysak 53a476e9ee importNames -> importDescriptiveInfo
This opens up the possibility of importing more than just names.
2026-03-26 16:28:48 +00:00
Ivan Krysak 79618b3b63 CliftImportModel: extract name importing 2026-03-26 16:00:49 +00:00
Ivan Krysak 01658cab09 import-model-names: split into two
One is module-granularity (name unchanged). The other (new) one
is function-granularity: `import-function-model-names`.
2026-03-26 16:00:49 +00:00
Ivan Krysak 58facb0de2 pipebox: introduce two more clift containers
`CliftSingleTypeContainer` for a type-level entity and
`CliftModuleContainer` for a binary-level one (like a header).
2026-03-25 17:26:24 +00:00
Ivan Krysak b76a09d483 pipebox: rename CliftContainer.h
The new name is `CliftContainers.h`.
2026-03-25 17:26:24 +00:00
Ivan Krysak 2841f8ab84 Introduce module-level CliftContainer 2026-03-25 17:26:24 +00:00
Ivan Krysak a3c43f92d4 Rename CliftContainer > CliftFunctionContainer 2026-03-25 15:42:13 +00:00
Ivan Krysak 2d2ba9c107 Split clift kinds into two: module and function 2026-03-25 15:42:13 +00:00
Ivan Krysak 1310b6ab62 Clift: append C to attribute classes we emit 2026-03-25 15:42:13 +00:00
Ivan Krysak 5fdc99c4da Minor improvements 2026-03-25 15:42:13 +00:00
Andrea Gussoni 02cc6923d0 EmitFieldAccesses: implement pass
The `EmitFieldAccesses` pass transforms `clift` by taking pointer-typed
expressions computed via integerr arithmetic with type-safe field
accesses and array accesses.

The transformation is split in three main phases:
1) `PointerArithmetic` computation.
2) `BestTraversal` computation.
3) `FieldAccess` `clift` rewrite.

The high level driver is implemented in the `EmitFieldAccesses` header
and cpp, while the nested 3 phases are implemented respectively in
`PointerArithmetic`, `BestTraversal` and `FieldAccessReplacement`.

The `computerPointerArithmetic` phase is concerned with taking a
pointer-typed `ExpressionOp`, called `PointerToReplace`, and expressing
it in a `BasePointer+Offset` form.

The `computeBestTraversal` phase is concerned with computing the best
traversal of the type pointed to by `BasePointer`, that can be used to
rewrite the pointer arithmetic in `clift` with just field accesses and
array subscripts.

The `replaceFieldAccess` phase takes the `Traversal` computed at the
previous step, and actually rewrites in `clift` the `PointerToReplace`
in terms of field accesses and array accesses w.r.t. the `BasePointer`.
2026-03-18 17:25:13 +01:00
Giacomo Vercesi 6ec9f9a952 TupleTree: overhaul reference caching
Overhaul the logic and method names involved in enabling and disabling
reference caching in `TupleTree<T>`. `TupleTreeReference<T, U>` now
lazily caches the target and will traverse the path only when needed.
Also expose and use these functions in the new pipeline, which should
provide some speedup when executing a `Schedule`.
2026-03-04 14:58:02 +01:00
Giacomo Vercesi 704c5e9bbb TupleTree: fix broken operator==
The `operator==` for keyed `StructDefinitions` was the comparison
between keys, which is misleading.
2026-03-04 14:58:02 +01:00
Giacomo Vercesi 1193b6ef34 TupleTree: upgrade Version: 0
When a `TupleTree` is deserialized, if it has the `Version` field set to
0 upgrade it automatically to the `SchemaVersion`.
2026-03-04 14:58:02 +01:00
Giacomo Vercesi d479438d3c Add ImportFromC analysis to pypeline 2026-03-04 14:58:02 +01:00
Giacomo Vercesi 8804092b90 Add ConvertFunctionsToRaw analysis to pypeline 2026-03-04 14:58:02 +01:00
Ivan Krysak 41378913b2 CTokenEmitter: add a suffix-less literal helper 2026-03-04 08:20:00 +00:00
Ivan Krysak b63102ed12 CTokenEmitter: introduce Macro entity kind 2026-02-27 18:28:12 +00:00
Ivan Krysak cd6c6bd22d Introduce isSeparateDeclarationAllowed helper
This is a replacement for `isDeclarationTheSameAsDefinition`.
2026-02-27 18:28:12 +00:00
Ivan Krysak 3bec80c9ba PTML: introduce c.macro token type 2026-02-27 18:28:12 +00:00