Commit Graph

555 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 90a327b10f Add clifter-input debug artifact 2026-05-04 10:49:07 +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
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 51323c4707 Introduce revng model export sqlite
This tool exports into a SQLite DB the prototypes of the functions in a
given model, along with the closure of its type dependencies.
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 8bf4923b27 revng fetch debug-info: use lowercase PDB ID 2026-04-23 13:40:42 +02:00
Alessandro Di Federico 7049f61baa Minor changes 2026-04-23 13:40:41 +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 aa28975c3f LocalStorageProvider: prune on startup
Add two situations where the cache is pruned on startup, removing all
the cached objects from storage:
1. the version field does not match the current one
2. the model has been changed out of band

The second one is very important as it allows to use the revng2 CLI
while editing the model manually on disk.
2026-04-10 11:45:13 +02:00
Giacomo Vercesi e5ca09e0f3 pypeline-storage: drop revng_ prefix
Drop the `revng_` prefix for the version field.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi 0a18cb94f5 Cleanup revng.support.artifacts
Remove a few `Artifact` classes from `revng.support.artifact`. These
were needed to handle the idiosyncrasies of the legacy pipeline. Some of
the logic has been reworked into the ptml code.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi 3a5dc835de revng.project: port to pypeline
Convert `revng.project` to use the `revng2` command-line and the `revng
project daemon` server instead of the legacy ones.
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 a91d87315a pypeline daemon: add /status endpoint
Add a `/status` endpoint to the daemon that allows verifying that the
daemon is up.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi f626dece53 Add revng2 project dump-pipeline
Add the `revng2 project dump-pipeline` command which allows emitting the
pipeline description from the command-line.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi 18e3501731 pypeline: implement proper config parsing
Overhaul the pipeline configuration logic by collapsing all dynamic
configuration options, both for analyses and pipes into a single
dictionary. Change all the interfaces so that there is no longer
distinction between the configuration of an analysis and of pipes.
Expose these options to the command line via `--{name}-configuration`
options for each pipe/analysis that is applicable to the command-line
invocation.
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
Giacomo Vercesi 9fd3077081 pype: adopt option group for wrappers
Group all the wrapper options (`--lldb`, `--gdb`, etc.) in an option
group, so that they are rendered in an indented section.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi d41f7bcd6e LocalStorageProvider: handle OSErrors
Ignore `OSError`s in `LocalStorageProvider` when rebuilding the list of
files for a given hash, since those paths might have become inaccessible
in the meantime.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi 2afcb4ec67 pype: improve output on wider terminals
Click clamps the output of its help to 80 columns, this makes reading
the help on wider terminals quite annoying. Change the formatter class
used to allow better help output on wider terminals.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi f0890e6617 revng.support.to_bytes: handle empty files
`mmap` throws an error when opening empty files, add code to check this
situation and return a zero-length byte string.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi b2293fec30 pypeline: fix Pipeline.run_analysis_list
Fix the `run_analysis_list` method as it had an incorrect way of
computing the overall list of invalidated artifacts.
2026-03-31 17:00:49 +02:00
Giacomo Vercesi a904f356a4 pypeline-daemon: clean up websocket code
Clean up the code related to the handling of websockets and allow the
daemon to be terminated gracefully without any error messages.
2026-03-31 17:00:49 +02:00
Giacomo Vercesi a886c0509f pypeline: fix savepoint_id_to_artifact 2026-03-31 17:00:49 +02:00
Giacomo Vercesi fd95c7704e pypeline: expose artifact's pipe dependencies
Add an additional piece of metadata that states which pipes are used to
compute a specific artifact. This can be used to derive which
configuration options influence the creation of an artifact.
2026-03-31 17:00:49 +02:00
Giacomo Vercesi 9b68cf4a39 pypeline-daemon: rework /artifact endpoint
Rework the artifact endpoint, making it similar to the CLI invocation.
It now works on a single artifact and can be made to return both `json`
and `tar` as formats.
2026-03-31 17:00:49 +02:00
Giacomo Vercesi 20059b5f3a pypeline: make Container.serialize selective
Change the `Container.serialize` interface so that it is possible to
supply a list of objects that will be serialized instead of all the ones
in the container.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 644b71b319 pypeline: add additional artifact PTML metadata
Add two additional fields to `Artifact`: `defined_locations` and
`preferred_artifacts`. These are pieces of metadata that allow
navigation between multiple PTML-enabled documents.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi b9051e494b pipeline: add missing cross-relations artifact 2026-03-31 17:00:48 +02:00
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
Giacomo Vercesi 7a152425ca pypeline: add filename to artifact
Add a meta-information field to the artifact that adds an hint of what
filename a single object of an artifact should be represented in a
filesystem.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 4c6436f7b2 pypeline: introduce artifact category
Add categories in the pipeline, allow an artifact to have a category
specified which allows it to be shown or hidden by default. Adapt the
CLI tools to hide artifacts of the category that don't
`show_by_default=True`.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 39f1a9c3a9 pypeline: drop underscores from pipeline yaml
Remove the only instance of underscores in the pipeline yaml from the
use of `analysis_lists`. Substitute it with `analysis-list`.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi fc9193a0a8 pypeline: convert pipeline parser to class
Since most functions in `pipeline_parser.py` had a lot of redundancy in
the parameters passed, convert all of them to be part of a
`PipelineParser` class which stores all the variables.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 550ac7b700 pypeline-daemon: add put-file endpoint
Add an endpoint to the daemon that allows adding a file to the file
storage.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 6dc053e55c pypeline-daemon: rework error propagation
Rework how errors are propagated from the daemon code to the HTTP
client, creating an exception hierarchy to handle the most common
cases.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 14d95a924d pypeline: rework fields in pipeline metadata
Rework which information is transmitted in the pipeline metadata,
avoiding redundancy and moving some information there instead of
returning it every time a request is made.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi a13cffab19 pypeline: rename pipeline metadata schema file
Rename the schema that describes the metadata of the pipeline from
`web_schema.yml` to `pipeline-description-schema.yml`.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi c53e615fa0 Cleanup pypeline code
Remove some cruft and apply trivial changes to the existing pypeline
code, especially on the daemon side.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 773245b893 pypeline/cli: use dataclass for ctx.obj
Add typing to the `ctx.obj` object used to store pypeline-specific data
while parsing the command-line in click.
2026-03-31 17:00:48 +02:00
Ivan Krysak 754cfd57fe Model: introduce migration to version 9 2026-03-27 08:19:21 +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