Commit Graph

529 Commits

Author SHA1 Message Date
Tommaso Fontana 80eb02c207 Pypeline: merge pypeline 2025-09-10 12:05:15 +02:00
Ivan Krysak f03654564e Emit _STARTS_AT on fields with custom names 2025-09-05 10:15:32 +03:00
Ivan Krysak 3eea4c4094 Always emit _SIZE on struct definitions 2025-09-04 16:57:12 +03:00
Ivan Krysak c6a175a1b9 Rename _START_AT -> _STARTS_AT 2025-08-29 14:00:29 +03:00
Ivan Krysak b656381ec5 Update ptml documentation
This also reorders definitions in `revng/Pipes/Ranks.h` to match
the order used by the docs.
2025-07-23 11:38:53 +02:00
Ivan Krysak 461c49df25 Model: bump version to 5 and introduce migration 2025-07-23 11:38:52 +02:00
Ivan Krysak 343ba2ff8a ABI: fix msvc GPR usage for small aggregates 2025-07-23 11:38:51 +02:00
Ivan Krysak 3a7ec51a6c Pipeline: fix emit-recompilable-archive
Because of misplaced `From` value, comment we not adopted by
the recompilable archive, leading to desyncronization between it
and the usual decompilation branch of the pipeline.
2025-07-23 11:38:51 +02:00
Giacomo Vercesi 29d7f2d8a8 artifacts: allow parsing the recompilable archive
Allow the artifacts machinery to parse, via `pycparser`, the
recompilable archive provided by revng via the
`emit-recompilable-archive` artifact.
2025-07-18 09:30:56 +02:00
Giacomo Vercesi 38b50c2977 tupletree: fix Reference class
Fix the `Reference` class, make it work with the new model and allow it
to be dereferences via the `_accessor` attribute.
2025-07-18 09:30:55 +02:00
Giacomo Vercesi 460ffbf965 project: move some methods to Binary
Move some methods from the `Project` class to `model.Binary`.
2025-07-18 09:30:55 +02:00
Alessandro Di Federico 4378576eed Python scripting: get_example_binary{,_path} 2025-07-18 09:29:09 +02:00
Lauri Vasama e9b18d448b Add Clift emit-c pipe and end-to-end tests 2025-07-17 16:45:03 +02:00
Lauri Vasama 28550f2f57 Add explicit pointer size support in old backend
When `Configuration.ExplicitTargetPointerSize` is set, the backend uses
explicit pointer type sizes (e.g. `pointer32_t(T)`).
2025-07-17 16:45:03 +02:00
Lauri Vasama 9d39020034 Add LLVM-to-Clift import pipe 2025-07-17 16:45:03 +02:00
Lauri Vasama 1addc26e58 Add remove-constant-array-returns pass 2025-07-17 16:45:03 +02:00
Lauri Vasama 74588ae684 Rename MLIRFunctionKind to CliftFunction 2025-07-17 16:45:03 +02:00
Giacomo Vercesi 569b9d11b5 end-to-end: add test to check decompile output
Add an end-to-end test that checks that the decompile output is a valid
tar file and it contains all the functions defined in the model.
2025-06-27 17:12:18 +02:00
Giacomo Vercesi 0a2cb4df12 TTG: move namespace to the cpp generator
The `namespace` property is strictly used just by the cpp generator.
Move the code so the `--namespace` option is exclusive to it and removed
for all the other generators.
2025-06-25 15:40:13 +02:00
Giacomo Vercesi d62b7b6b1a TTG: inline root type in schema
Move the root type inside the schema definition, as it is a property of
it and not of the generator.
2025-06-25 15:40:13 +02:00
Giacomo Vercesi d404fee38f Unify TTG CLI tool for generation
Merge all the command-line scripts for generating tuple-tree
implementations into a single `tuple-tree-generate.py` script. Move all
the other files a directory down.
2025-06-25 15:40:13 +02:00
Giacomo Vercesi d53312d867 Rename CppHeadersGenerator to CppGenerator
Since the generator produces more than just headers, rename the class
and the file to just `cpp`.
2025-06-25 15:40:13 +02:00
Pietro Fezzardi c2def30b61 Re-enable tests formerly disabled do to a bug
This commit turns on some old tests that were disabled for a bug.

The comment on the disabled tests said that it was due to a bug in type
inlining, but it was actually caused by a bug in the computation of
dependencies in DepenencyGraph.

Type inlining is now gone, and DependencyGraph has been fixed, so it's
now possible to re-enable these tests.
2025-05-29 09:38:09 +02:00
Pietro Fezzardi ea3cbe4c1b Drop type inlining
Type inlining was a feature that allowed type definitions of
structs/unions/enums to be printed in C directly inside the definition
of another parent struct/union, if the inner type was only used once in
the parent type.

This kind of reasoning is inherently global: a type definition of the
subtype can be inlined in the parent type one only if *globally* the
subtype it isn't referred anywhere else.

This caused issues with type inlining inside definitions of stack types
in the body of functions. Indeed, for a given function, due to type
inlining, it was necessary to do global reasoning about what other types
could be inlined in the definition of the function's stack frame type.
This, in turn, had heavy consequences on invalidation, because any
change to any type (even if it wasn't referred in a given function's
body) was causing invalidation of all functions' bodies.

For this reason it was decided to drop the type inlining feature.
2025-05-28 17:11:56 +02:00
Pietro Fezzardi 12078ac30b revng-pipelines.yml: use kebab-case
for SingleTargetFilename.
2025-05-13 16:18:34 +02:00
Ivan Krysak 2c7cc0edab Model: rework migration tests
This makes them a lot more modular, making it easier to add similar
tests for future model versions.
2025-05-08 15:42:02 +02:00
Ivan Krysak 63bf36621c Docs: update the supported location list 2025-05-08 15:42:01 +02:00
Ivan Krysak 6fd6a0af43 Pipes: add a rank for raw stack arguments 2025-05-08 15:42:00 +02:00
Ivan Krysak 0d868894a2 model::Function: switch to indices as comment keys 2025-05-08 15:42:00 +02:00
Giacomo Vercesi 89b17d2325 Python client: add user manual 2025-05-07 12:04:15 +02:00
Giacomo Vercesi 3e3779498e Implement python interface for revng
Add a python interface (`revng.profile`) for interacting with the rev.ng
infrastructure as a whole; either through the CLI (`CLIProject`) or the
GraphQL API (`DaemonProject`).
2025-05-07 10:48:51 +02:00
Giacomo Vercesi de997ca2e4 python TTG: add mixins infrastructure
Add the infrastructure code needed to allow to add mixins to Tuple-Tree
Generated classes in python.
2025-05-07 10:48:50 +02:00
Giacomo Vercesi d63bba17c6 Implement LLMRenameAnalysis
Implement an analysis in revng which allows renaming the variables of a
C function via an LLM.
2025-05-06 09:59:46 +02:00
Giacomo Vercesi 591107cdce Overhaul PTML functionality
The logic of the `revng ptml` command was too tightly coupled with the
parsing of the xml. Overhaul the structure of the ptml code and split it
in two locations:
* `revng.ptml`: this module contains functions that allow easy
  manipulation of PTML, both for printing it and for obtaining the split
  metadata/text version.
* `revng.internal.cli._commands.ptml`: this implements the actual `revng
  ptml` command. This leverages the new logic in the `revng.ptml` module
  while maintaining the same functionality.
2025-05-05 17:28:48 +02:00
Giacomo Vercesi 6f481a3127 docs: fix tip admonition
Fix the tip admonition using the `:::` marker which is incorrect. Use
the `!!!` marker which is the correct one.
2025-05-05 16:02:40 +02:00
Andrea Gussoni 928edb0015 Pipeline: introduce materializetrivialgoto 2025-04-30 16:10:54 +02:00
Khaled Ismaeel 030becfeba Adapt the build to the new schema version field
This is a followup to the commit where we introduced the `version`
field in the schema YAML.
2025-04-30 15:08:45 +02:00
Khaled Ismaeel 531d9b866c Remove the now-redundant HEADERS list 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 53a5ff07cf Remove embedded TUPLE-TREE-YAML 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 63469c9cd6 Use unified YAML schemas in the build process
In this commit we instruct the build system to use the unified schema
files  instead of collecting the `TUPLE-TREE-YAML` comments.

The fixes to C++ files are necessary because they depend on the order
of the fields in the schema, which was changed.
2025-04-30 15:08:45 +02:00
Giacomo Vercesi 0ac78dddba Fix codespell errors
Fix erros detected by the new version of `codespell`.
2025-04-24 13:22:14 +02:00
Pietro Fezzardi 5ca182578b Add InstCombineNoArraysPass
This pass wraps LLVM's vanilla InstCombine, to hijack one of its
options. The goal of this hijack is to prevent InstCombine from
splitting and replacing accesses to arrays with GEPs and smaller
accesses.
2025-04-22 17:23:37 +02:00
Pietro Fezzardi ef2c3a7626 Add SROANoArraysPass
This pass wraps LLVM's vanilla SROA, to hijack one of its options.
The goal of this hijack is to prevent SROA from splitting and replacing
memory accesses to arrays with GEPs and smaller accesses.
2025-04-22 17:19:56 +02:00
Ivan Krysak 79964eac74 Avoid ' misuse in error messages and comments 2025-04-17 16:41:21 +02:00
Ivan Krysak 76ed261375 Use revng_undefined_ instead of init_
Current `init_` prefix used to set the default values of SCVs
is very common in typical code, hence it would cause a lot of
collisions.
2025-04-17 11:19:17 +03:00
Ivan Krysak 0c99d5d5fb IDBImporter: omit unnecessary typedefs 2025-04-17 11:19:17 +03:00
Ivan Krysak b72bcd7dd2 Introduce a basic problem name reporting system 2025-04-17 11:19:17 +03:00
Ivan Krysak aa15d8ca21 Standardize abort-like function usage 2025-04-17 11:19:17 +03:00
Ivan Krysak 4cde1f614c support.h: mark unknown_pc as noreturn 2025-04-17 11:19:17 +03:00
Ivan Krysak e579da5f9d early-linked.c: use an uglier name for ignore 2025-04-17 11:19:17 +03:00