682 Commits

Author SHA1 Message Date
Giacomo Vercesi 27f419c8cd Fix and ban namespace clobbering
Fix an instance where the `std` namespace got clobbered into the global
namespace by accident.
2026-02-16 10:34:38 +01:00
Giacomo Vercesi f9ac4db8ba Remove use of PIE compiler options
The position-indipendence of the code is set by the build environment.
2026-02-16 10:34:38 +01:00
Lauri Vasama aa2597d13b model::Function: add stack frame name and comment
* StackFrameType() is removed.
* StackFrame() is introduced in its place.
* Use StackFrame().Type() to acess the stack frame type.
2026-02-13 08:41:39 +02:00
Giacomo Vercesi 01e9de1c34 compare_isolate.sh: don't compare declarations 2026-02-05 10:20:45 +01:00
Alessandro Di Federico f443bcc6da Model migration tests: suppress output 2025-12-22 11:34:46 +01:00
Alessandro Di Federico ce4f6ef996 llvmName: turn into a free function 2025-12-22 11:34:46 +01:00
Alessandro Di Federico 9d76a2ff52 for-collect-cfg: test Windows dynamic calls 2025-12-22 11:31:54 +01:00
Giacomo Vercesi 664eb497c1 isolate: selectively clone helpers
When performing `cloneFiltered`, instead of cloning all the helper
functions only clone those that are transitively called from the isolated
function.
2025-12-19 10:29:28 +01:00
Alessandro Di Federico 5820908675 Remove and ban \file 2025-12-16 17:41:55 +01:00
Giacomo Vercesi 94b9ecad6c mass-testing: exclude paths from flamegraph
Add a new option to the mass-testing `meta.yml` that allows skipping
some paths when generating the flamegraph. In the case of revng this
allows skipping the intermediate python frames.
2025-12-12 15:46:49 +01:00
Giacomo Vercesi 793b8999e9 Adapt mass-testing infrastructure to pypeline
Make the required changes so that `revng2` can be used with mass-testing
and the per-component stats are correct.
2025-12-12 15:46:49 +01:00
Giacomo Vercesi e3b263d9da Implement revng2 project init 2025-12-10 16:16:14 +01:00
Giacomo Vercesi 47038d46ec Add ParseBinaryAnalysis to pypeline 2025-12-10 15:05:53 +01:00
Giacomo Vercesi 27f2407a36 pypeline-comparison: omit metadata in lift
Do not compare metadata when comparing `lift` as the output is still
non-deterministic in some instances.
2025-12-10 15:05:53 +01:00
Lauri Vasama 40e1ad5d23 Add -Wno-array-bounds for check-decompiled-c 2025-12-05 19:53:41 +02:00
Lauri Vasama d4114ae188 Implement bit_cast in Clift backend 2025-12-05 19:53:41 +02:00
Alessandro Di Federico 5045506ce0 model-migration: use no-op analysis 2025-12-03 17:59:19 +01:00
Alessandro Di Federico 4c833e6227 emit-c: add peephole-opt-* and ternary-reduction 2025-12-03 17:59:19 +01:00
Alessandro Di Federico f435443630 tests: adopt emit-c over decompile 2025-12-03 17:59:19 +01:00
Alessandro Di Federico aa4120e1e2 tests/scripting.py: drop decompile, use emit-c 2025-12-03 17:59:19 +01:00
Tommaso Fontana fe3a5b6287 Pypeline: add --tar, --yaml to pype commands
Now commands 'pype project artifact' and 'pype pipeline run_pipe' now
accepts --format to specify in which format to serialize the resulting
container, and have --tar and --yaml shortcuts. Moreover, these commands
and 'pipe pipeline run_analysis' can automatically figure out the format
of containers so the user won't have to specify them most of the time.
2025-11-24 16:41:15 +01:00
Giacomo Vercesi e32c92b164 Add pypeline comparison tests
Add a set of tests to the test suite that compare the output of the new
pipeline (via `revng2`) to the output of the old one.
2025-11-18 17:47:54 +01:00
Giacomo Vercesi 57ae281403 verify-abi-test-binaries: remove orc shell
`orc shell` should not be used in the revng codebase in general,
moreover the PATH already contains all the entries needed to invoke the
`llvm-dwarfdump` command.
2025-11-17 10:04:12 +01:00
Alessandro Di Federico 1429b526ab Introduce libtcg
This commit drops libptc in favor of its new form libtcg.

It brings several improvements, among which:

* The QEMU version we work on has been upgraded.
* CPUStateAccessAnalysis has been reimplemented in a way that makes it
  easier to debug and solves some limitations (e.g., tracking leaking
  pointers).
* Identification of pieces of the CPU state that are read by each helper
  and fixing access to the CPU state is now performed at build-time.
* We no longer mmap the code we need to translate, dropping all the
  issues related to code that needed to be mapped where something is
  already present.
* We now have two distinct flavors of helper modules: the full one and
  the "slim" one. The latter contains the definition only of functions
  we intend to inline. It is used in most of the pipeline, a good thing
  since we spend less time optimizing code we don't really care about.
  The full module is only used on the re-compilation branch of the
  pipeline.
* We no longer split the `cpu_loop` function.
* We change MetaAddress to rely on architectures from `model::` as
  opposed to the LLVM ones.
* We no longer attach debug info to LLVM IR containing the original
  assembly.
* We now verify that the lifted code only contains code we expect.
2025-10-31 17:25:03 +01:00
Alessandro Di Federico 90f21a10a8 check-conventions: enable excluding specific files 2025-10-28 09:18:24 +01:00
Alessandro Di Federico 81f063d30c Old backend: suppress -Wshift-count-overflow 2025-10-24 18:21:13 +02:00
Ivan Krysak 8bbbe10396 Ban unwrapped IRBuilder 2025-10-21 19:17:08 +03:00
Lauri Vasama 2b8701bb94 Add Clift optimization pipe 2025-10-21 09:15:40 +02:00
Lauri Vasama bf5adce413 Overhaul Clift loop syntax, add break/continue 2025-10-21 09:15:40 +02:00
Giacomo Vercesi 40da49548b Add Binaries list to the model
Add to the model an entry detailing the list of input binaries under
`Binaries`. This will be referenced by `Segments` when needed.
2025-10-16 17:48:45 +02:00
Giacomo Vercesi e57442fafe Introduce Tar.h
Split off the `GzipTarReader` into `Tar.h`, include a normal
`TarWriter` class which leverages libarchive to generate the tar file.
2025-10-16 16:08:05 +02:00
Ivan Krysak 45cc832602 Docs: do not spell default values
Note that a seemingly random relocation appeared from who knows where,
I wonder what's going on with it.
2025-10-13 18:33:10 +03:00
Ivan Krysak 2d618120e0 TTG: add default: value support
This also unifies `get_default_value` helper across all the target
languages.

Before this, there were two different versions of it for python
and typescript while c++ side didn't have one at all.
2025-10-13 18:33:10 +03:00
Ivan Krysak 23a0a09d21 TTG: add --string-type support to cpp generator
Note that other code-generating TTG-backends (namely python and
typescript) emitting ones already support this. This is just a matter
of extending similar logic to the c++ backend.
2025-10-13 18:33:10 +03:00
Ivan Krysak 859e122081 EFA: make TTG verification more strict
Some stuff that was before implicitly checked during deserialization
now need explicit checks, those are introduced here.

This also fixes test failures related to the changed serialization
format (which fields can or cannot be omitted when they have
the default value).
2025-10-13 18:33:10 +03:00
Ivan Krysak 6c0c758e67 Model: make TTG verification more strict
Some stuff that was before implicitly checked during deserialization
now need explicit checks, those are introduced here.

This also fixes test failures related to the changed serialization
format (which fields can or cannot be omitted when they have
the default value).
2025-10-13 18:33:10 +03:00
Ivan Krysak cc57e57fd1 TTG: remove support for optional: true fields
After this commit, every non-key field is treated as if it was optional
while every key field (plus every auto-generated `Kind` field) - as if
it was required.
2025-10-13 18:33:10 +03:00
Ivan Krysak 10ca432cb2 TTG: simplify reference field usage
This allows to avoid having to specify the `rootType` (stable within
the entire tree) manually each time a reference is introduced.
Thanks to that, a much nicer syntax of:
```yaml
- name: MyTypeField
  reference-to: TypeDefinition
```
can replace the current one:
```yaml
- name: MyTypeField
  reference:
    pointeeType: TypeDefinition
    rootType: Binary
```
2025-10-13 18:33:10 +03:00
Ivan Krysak 480443f358 TTG: drop upcastable: configuration option
Instead, detect whether `UpcastablePointer` wrapping is needed or not
based on the type.
2025-10-13 18:33:10 +03:00
Ivan Krysak 00ea93c99e TTG: move metaschema.yml to share/revng/ 2025-10-13 18:33:10 +03:00
Ivan Krysak e56f543b1a Split module.bc.zstd 2025-10-13 10:26:41 +03:00
Ivan Krysak ed53e759c9 Do not use -Y flag
Yaml model are now the _only_ way to store them, no point in still
specifying the old flag for it.
2025-10-13 10:26:41 +03:00
Lauri Vasama 653d451e6c Remove undef name configuration support
Also adds a model migration removing
Configuration.Naming.UndefinedValuePrefix.
2025-09-29 18:05:55 +03:00
Lauri Vasama 77adbcc5ba Add import-model-names pipe 2025-09-29 18:05:55 +03:00
Andrea Gussoni 855a9309ec MaterializeLoopScopes: drop pass
Drop the `MaterializeLoopScopes` pass after the re-design the loop
matching stage to work entirely on `clift`, without the need to insert a
`scope_closer` edge to guide the emission.

Simultaneously, drop the DAGify `Head` metadata insertion, since it will
not be checked anymore during the `MaterializeLoopScopes` pass.
2025-09-26 10:39:09 +02:00
Giacomo Vercesi 688b9fe111 Introduce compatibility with revng-pypeline
Add the necessary machinery to allow `Pipe`s, `Analysis`es,
`Container`s, `Model` and `ObjectID` to be implemented in C++ and used
by Python.
2025-09-17 14:02:40 +02:00
Giacomo Vercesi 5f5d2da842 check-conventions: check CMakeLists.txt license
The `check-conventions` script inadvertently ignored checking the
license header in `CMakeLists.txt`. Change the script so that those are
checked. Also add the missing headers to the reported files.
2025-09-17 14:02:40 +02:00
Ivan Krysak 8cc4082223 model-from-scratch: fix a broken link 2025-09-12 18:57:48 +03:00
Ivan Krysak 3c8ca061ef model-from-scratch: improve wording 2025-09-12 18:57:31 +03:00
Pietro Fezzardi 37cadeabd4 PTML doc: clarify supported and allowed actions 2025-09-10 18:48:06 +02:00