682 Commits

Author SHA1 Message Date
Pietro Fezzardi f3639d4649 Add ExtractValueToGEP pass
Add a canonicalisation pass that rewrites extractvalue from a
pointer-returning struct as an i8 GEP plus a load. Together with
ArithmeticToGEP this lets later passes consume the result through
the same GEP-based interface they use for ordinary memory accesses.
2026-05-08 11:37:10 +02:00
Pietro Fezzardi cb5702dc04 Add ArithmeticToGEP pass
Introduce the ArithmeticToGEP canonicalisation pass. It detects
pointers (LLVM-typed pointer values, model pointers flagged by the
"revng.pointers" metadata, and pointer-tagged extract values) and
rewrites integer arithmetic computed on top of them as i8 GEPs,
followed by a ptrtoint when the original use needs an integer.

For each obvious pointer the pass also walks backwards through Add
chains and disambiguates the pointer operand of each Add when the
other operand cannot be a pointer, so the rewrite extends to integer
arithmetic that only later flows into a pointer use.
2026-05-08 11:37:10 +02:00
Lauri Vasama a46b3eead9 Remove x86-64 reduce-c-casts test 2026-05-04 10:49:08 +03:00
Lauri Vasama c7e3a12657 Add implicit cast elision pass 2026-05-04 10:49:07 +03:00
Lauri Vasama dd4e452f96 Add data model import pipes 2026-05-04 10:48:16 +03:00
Lauri Vasama 0ab9f769dd Add CDataModel in ABI definition 2026-05-02 17:21:47 +03:00
Lauri Vasama 9bd76c71f9 Split up Clift optimization pipe 2026-04-30 15:09:16 +03:00
Lauri Vasama 8dd394c4f9 Disable -Wunused-but-set-parameter 2026-04-30 15:09:16 +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
Alessandro Di Federico 6894862ef2 Implement platform roots support
Refactor the binary import and dependency resolution infrastructure to
support multiple platforms (Linux, Windows, macOS) via a
configuration-driven root system.

Major changes:

* Overhaul PDB and DWARF importers for platform-aware debug info
  loading.
* Refactor LDDTree into a template-based architecture with
  platform-specific implementations (ELF, PE/COFF).
* Mostly rewrite the PDB importer, which had significant limitations.
2026-04-24 17:54:09 +02:00
Alessandro Di Federico eb9e82477a Introduce WindowsApiSetSchemaParser 2026-04-23 13:40:43 +02:00
Alessandro Di Federico 0385e4c652 Introduce revng::Configuration 2026-04-23 13:40:43 +02:00
Alessandro Di Federico 5b43a23060 BinaryIdentifier: s/.Name/.CanonicalPath/g 2026-04-23 13:40:42 +02:00
Alessandro Di Federico 3a0bbb00c5 verify-abi-test-binaries.sh: limit --use-pdb usage 2026-04-23 13:40:42 +02:00
Alessandro Di Federico d977f26bce import-from-c test: improve error reporting 2026-04-23 13:40:42 +02:00
Ivan Krysak e693cdbd53 model-verify-clift -> verify-against-model 2026-04-22 08:19:30 +00:00
Ivan Krysak 7edc4b3da6 CEmitter: emit function type attributes 2026-04-22 08:19:28 +00:00
Pietro Fezzardi 4735dfb460 Fix model-migration.yml: bash negation 2026-04-10 15:27:24 +02:00
Pietro Fezzardi df5139027c Add -fno-strict-aliasing to compile-flags.cfg 2026-04-10 15:27:24 +02:00
Pietro Fezzardi 7dce4fba42 Improve documentation of compile-flags.cfg 2026-04-10 15:27:24 +02:00
Giacomo Vercesi a8e13e4ee7 docs: fix
Fix the docs so that `revng test-docs` passes. Rework the
`model-from-scrach.md` to use the new pipeline.
2026-04-10 11:45:13 +02:00
Giacomo Vercesi 96f2ad60b4 Fix scripting tests 2026-04-10 11:45:12 +02:00
Giacomo Vercesi 90e8cce41e model: rework python mixin infrastructure
Rework the python mixin infrastructure for the model. Mixins are now
specified explicitly instead of using the `ast` module. The mixins are
loaded relative to the generated python file, this allows to have two
models: `revng.model` and `revng.project.model`. The latter is augmented
via mixins to have project-specific facilities such as `get_artifact`
and artifact accessors.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi ee7ce2d9a3 revng2 quick artifact: use subcommands
Make each artifact a subcommand of `revng2 quick artifact` so that it
behaves the same way as `revng2 project artifact`.
2026-04-10 11:45:12 +02:00
Lauri Vasama a37f3195d9 Homogenize static assertions in primitive-types.h 2026-04-08 11:12:41 +03:00
Lauri Vasama b062b23ad6 Include stddef.h in primitive-types.h 2026-04-08 11:12:41 +03:00
Ivan Krysak dab7e61f4a attributes.h: introduce _NORETURN 2026-03-27 08:26:29 +00:00
Ivan Krysak 307ddcfeaf attributes.h: introduce _ALWAYS_INLINE 2026-03-27 08:26:04 +00:00
Ivan Krysak 5631fe68fb attributes.h: reorganize the attribute order 2026-03-27 08:25:39 +00:00
Ivan Krysak 3e6c42f69c attributes.h introduce custom attribute helpers 2026-03-27 08:25:14 +00:00
Ivan Krysak 16611a93fc attributes.h: drop unnecessary macro definitions 2026-03-27 08:24:49 +00:00
Ivan Krysak 754cfd57fe Model: introduce migration to version 9 2026-03-27 08:19:21 +00:00
Ivan Krysak 16f4be79bb Migration tests: ignore empty lines 2026-03-27 08:18:57 +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 2d2ba9c107 Split clift kinds into two: module and function 2026-03-25 15:42:13 +00:00
Giacomo Vercesi 36f9dfe45b tests: leave TODO in tests to port/drop
Add TODOs to the test yamls of tests that are yet to be ported to the
new pipeline, the new backend or will be removed indefinitely when the
old pipeline is removed.
2026-03-05 14:23:06 +01:00
Giacomo Vercesi 26eca524d0 compare_isolate: exclude attributes
Blank out attribute identifiers and exclude attribute declaration lines,
as they might be swapped between executions.
2026-03-05 14:23:06 +01:00
Giacomo Vercesi 2a5c58791d Port tests to the new pypeline
Port as many tests as possible to use the `revng2`.
2026-03-05 14:23:06 +01:00
Giacomo Vercesi 4757cad690 pipeline-comparison: remove use of {push,pod}d 2026-03-04 14:58:02 +01:00
Giacomo Vercesi 807a240c4c Revert "Remove use of PIE compiler options"
This reverts commit f9ac4db8ba.
2026-03-04 14:58:02 +01:00
Ivan Krysak c1f05e4d24 Ranks: introduce the macro location 2026-02-27 18:28:12 +00:00
Ivan Krysak 95650e593d primitive-types.h: include stdbool.h 2026-02-25 14:10:44 +01:00
Ivan Krysak 1c3d11096d primitive-types.h: define NULL if absent 2026-02-25 14:10:44 +01:00
Ivan Krysak 22fe32afa2 Minor improvements 2026-02-25 12:47:27 +01:00
Ivan Krysak b5f98fcae9 check-conventions: ban anonymous header namespaces 2026-02-25 12:47:27 +01:00
Ivan Krysak a1f2853a04 check-conventions: reallow namespace x = a::b 2026-02-25 12:47:15 +01:00
Giacomo Vercesi 5ed18e65b7 docs: drop use of orc shell 2026-02-16 14:01:04 +01:00
Giacomo Vercesi 728ee2bb96 Add end-to-end test for --debug 2026-02-16 12:17:56 +01:00