83 Commits

Author SHA1 Message Date
Alessandro Di Federico 3e31edf817 Introduce FixPointerSize
This commit introduces `FixPointerSize`, a pipe changing the
`DataLayout` of module in order to have a pointer size identical to the
one of `targetABI()`.

The pipe also performs safety checks to ensure this does not corrupt
semantics.
2026-06-19 09:18:16 +02:00
Ivan Krysak ffc367f584 Pipebox: reorder containers and pipes 2026-06-15 17:28:22 +02:00
Ivan Krysak b0bc3eb2d8 Pipebox: streamline registration
Having manual indexing leads to having to touch all the following
entries when one is removed. It also makes adding new ones to
the middle of the list really awkward.

Instead of manual indexing, use a simple macro to come up with
the instance name on the fly.
2026-06-15 17:28:22 +02:00
Ivan Krysak 93e9b41769 EnforceABI: drop an unused class declaration 2026-06-15 17:28:22 +02:00
Ivan Krysak 5ddde903c5 emit-c-as-directory: move to new backend 2026-06-15 17:28:22 +02:00
Ivan Krysak 14ea4b6cd7 emit-c-as-single-file: move to new backend 2026-06-15 17:28:22 +02:00
Ivan Krysak 190405a77b Rename decompile-to-X pipes to emit-c-as-X
Note that the artifact names were intentionally left untouched.
2026-06-15 17:28:22 +02:00
Ivan Krysak 8426cf96cb emit-type-definition: new pipeline 2026-06-15 17:28:22 +02:00
Ivan Krysak 12355dc51e emit-helper-header: new pipeline 2026-06-15 17:28:22 +02:00
Ivan Krysak c82a01f68b emit-type-and-global-header: new pipeline 2026-06-15 17:28:22 +02:00
Ivan Krysak 6f9f6cf593 Introduce PTMLCTypeBytesContainer 2026-06-15 17:28:22 +02:00
Ivan Krysak 93f6be619a import-segment-declarations: new pipeline 2026-06-15 17:28:22 +02:00
Ivan Krysak 9a0d984c14 import-function-declarations: new pipeline 2026-06-15 17:28:22 +02:00
Ivan Krysak b1dc230199 import-types: new pipeline 2026-06-15 17:28:22 +02:00
Giacomo Vercesi dbc734f23a CMake: force use of Python3
Switch from using `find_package(Python ...)` to `find_package(Python3
...)` as it excludes that CMake picks a Python 2 version by accident.
2026-05-14 11:26:41 +02:00
Lauri Vasama dd4e452f96 Add data model import pipes 2026-05-04 10:48:16 +03:00
Lauri Vasama 90e5dfd4c9 Pass MLIRContext by address
Passing by address is more conventional. This is what MLIR does most of
the time, and it avoids dereferences and addressofs everywhere.
2026-04-30 15:09:16 +03:00
Lauri Vasama a338194eb7 Move namespace mlir::clift out of namespace mlir 2026-04-27 12:48:24 +03:00
Alessandro Di Federico 2629f95dd1 Introduce ImportPrototypesFromDatabase
This commit introduces an analysis to import prototypes from a SQLite
database of well-known prototypes, typically built from debug info of
operating systems.

This analysis supersedes import-well-known-models.
2026-04-24 17:54:09 +02:00
Ivan Krysak 5f511d8e17 verify-against-model: split into two
The resulting pipes are:
1. binary-granularity one with the name unchanged
2. function-granularity one called `verify-function-against-model`.
2026-04-22 08:19:30 +00:00
Ivan Krysak e693cdbd53 model-verify-clift -> verify-against-model 2026-04-22 08:19:30 +00:00
Giacomo Vercesi b40fec2270 Add LLMRename analysis to pypeline 2026-03-31 17:00:48 +02: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 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
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
Giacomo Vercesi f7231a29da Add yield-cfg to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 255748228a Add yield-call-graph-slice to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 4385f28c17 Add YieldCallGraph to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 9a202822f1 Add ProcessCallGraph to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi a8ed75fdb1 Add CleanupIR to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi d80c0a73f6 Add MergeLLVMModules to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 05dc279ef2 Add emit-c-as-single-file to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi e260d05082 Add EmitC to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 9b527c8b69 Add ImportModelNames to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi cfe476c701 Add ModelVerifyClift to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 75455a339e Add PureMLIRPassesPipe to pypeline
In the same vein as `PureLLVMPassesPipe`, add a pipe to pypeline that
allows running arbitrarily-specified MLIR passes that do not depend on
the model.
2025-12-10 16:16:14 +01:00
Giacomo Vercesi 97fe9203e1 Add LLVMToClift to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 08154335e3 Add SwitchToStatements to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi ee1fdebc4e Add SegregateStackAccesses to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 16e89416c5 Add CliftFunctionContainer
Add a container that owns one `mlir::ModuleOp` per function, to be used
in conjunction with the new clift backend.
2025-12-10 16:16:14 +01:00
Giacomo Vercesi e35f5750de Add ConvertFunctionsToCABI analysis to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 9e8e4cdf85 Add AnalyzeDataLayout analysis to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 5a6efb0fa2 Add DetectStackSize analysis to pypeline 2025-12-10 15:05:53 +01:00
Giacomo Vercesi c1217dcfc3 Add DetectABI analysis to pypeline 2025-12-10 15:05:53 +01:00
Giacomo Vercesi 405733369b Add ImportWellKnownModelsAnalysis to pypeline 2025-12-10 15:05:53 +01:00