Commit Graph

7504 Commits

Author SHA1 Message Date
Alessandro Di Federico 4c2eb97a18 DwarfImporteR: handle STT_GNU_IFUNC symbols
In DWARF, `STT_GNU_IFUNC` symbols are associated to a function prototype
returning the actual prototype.
2026-05-29 16:00:44 +02:00
Alessandro Di Federico 2e72494cb1 Drop --import-debug-info command-line option
The --import-debug-info CLI flag and the ImporterOptions::
AdditionalDebugInfoPaths field it populated were a side-channel that
loaded extra DWARF files outside the normal ELF dependency-resolution
path. It bypassed the symbol-aware machinery and is no longer needed.
2026-05-26 14:41:30 +02:00
Alessandro Di Federico e8fc9628ba Add model drop-types tool 2026-05-26 11:32:16 +02:00
Alessandro Di Federico c1d8d1fef1 Reorganize lit tests under tests/filecheck 2026-05-26 11:32:16 +02:00
Alessandro Di Federico 0399b20a28 Rework dropTypesDependingOnDefinitions 2026-05-26 09:52:17 +02:00
Pietro Fezzardi 599c282e94 Merge 'feature/clift-hoist-variable-initializers' 2026-05-25 10:12:10 +02:00
Lauri Vasama b078f2c809 Fix C label output around hidden statements 2026-05-25 09:00:41 +02:00
Lauri Vasama 5c9a7b4207 Fix C output around hidden casts
```
// before
(var_0.x)[1];

// after
var_0.x[1];
```
2026-05-25 09:00:41 +02:00
Lauri Vasama 039f533a9f Add ternary inversion rewrite pattern
```
// before
!x ? y ? z

// after
x ? z ? y
```
2026-05-25 09:00:41 +02:00
Lauri Vasama 5a5703ec10 Add expression rewrite descriptions 2026-05-25 09:00:41 +02:00
Lauri Vasama e30a09644e Introduce hoist-variable-initializers pass 2026-05-25 09:00:41 +02:00
Lauri Vasama d3dcc70c0c Implement cast elision for variable initializers 2026-05-25 09:00:41 +02:00
Lauri Vasama afaff540ed Implement Clift local variable self-assignment
Local variable initializer regions can now have a block argument
representing the local variable being initialized.
2026-05-25 09:00:41 +02:00
Lauri Vasama 3064653e37 Add StatementOpInterface::getBlockArgumentVariable
Translates a mlir::BlockArgument to an mlir::Value more directly
representing the entity or expression to which the block argument
refers, or null if not applicable for the statement in question.
2026-05-25 09:00:41 +02:00
Lauri Vasama 7fe96c2c9a Improve clift::isLvalueExpression 2026-05-25 09:00:41 +02:00
Lauri Vasama 23e06b5212 Erase requires in tighten-variable-scopes 2026-05-25 09:00:41 +02:00
Lauri Vasama ddcaa1fad2 Improve defer-allocas
* Discover deferrable allocas in a separate pass before applying changes
  in order to avoid double work.
* Defer allocas to just before the first user or the terminator, if no
  user exists in the target block.
* Move allocas when the target block is the same as the original block.
2026-05-25 09:00:41 +02:00
Alessandro Di Federico d235388948 Merge branch 'feature/prss' 2026-05-22 15:06:34 +02:00
Giacomo Vercesi 0eebbc912a Add tests for PRSS
Add tests for the PRSS component, these will be run as the `revng-prss`
category.
2026-05-22 15:05:04 +02:00
Giacomo Vercesi 828bd9c49f pypeline: add remote storage server
Add the PRSS (Pypeline Remote Storage Server) and the relay companion
server.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi ff4c899954 pypeline: add RSSStorageProvider
Add the storage provider (and factory) for the Pypeline Remote Storage
Server (PRSS).
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 3a9317d512 pypeline: factor out starlette middleware code
Factor out in a function the generation of the middleware list, to
facilitate reuse. Add the `AuthMiddleware` which allows authenticating
requests.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 25b90139f0 pypeline: rotate notification broker code
Move around the code pertaining to the notification broker, making the
various roles a bit clearer. This also de-couple the broker logic from
the local revng daemon.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 653f92514b pypeline: adopt hypercorn in place of uvicorn
Switch out from using uvicorn to hypercorn for the pypeline daemon, make
the facilities create hypercorn commands in stand-alone functions, as
they will be re-used for other servers later on.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 2f0f320711 revng2 project init: fix for non-local providers
Fix the `revng2 project init` command to work with all
`StorageProvider`s, not just the local one. It still specializes for the
local one to allow creating the model file.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 41ad874013 StorageProviderFactory: add lock_type parameter
Add the `lock_type` parameter to `StorageProviderFactory`, this allows
signaling what operations are going to be done while using the provider.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 40ae2d73dd Factor out BufferedReader in a standalone file
Move the `BufferedReader` class to a standalone file. This allows the
class to be reused in other packages.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 6f6cffde3b LocalProvider: add object_id_string to objects
Add the `object_id_string` to the `objects` table. This is for
debugging purposes as it's hard to figure out what is what with binary
objects ids.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi d7d87e237a LocalProvider: add migration logic
Add additional logic to allow the local database to be migrated to newer
versions.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi ccadc30709 StorageProvider: clarify prune purpose 2026-05-22 09:04:35 +02:00
Giacomo Vercesi edab3e26e9 ProjectMetadata: add additional fields
Expand the `ProjectMetadata` dataclass to include additional timestamps
and the hash of the pipeline description. Change all the
`StorageProvider`s so that all the new data is saved and returned.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 4e0f4a6540 pypeline: stabilize pipeline description
Before this commit the pipeline description suffered from some
non-determinism that led to some values changing between runs of
`revng`. Add extra sorting so to eliminate the non-determinism.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi a1878f0f05 StorageProvider: collapse object deps and saving
Consolidate the saving of object dependencies and saving the actual
objects' data into a single function called `add_objects`. The previous
methods `add_dependencies`, `add_custom_invalidation_data` and `put`
have been removed.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi bbff447181 pypeline: split ScheduledTask
Due to the drifting differences, split `ScheduledTask` into
`PipeScheduledTask` and `SavepointScheduledTask`, which allows each to
specialize on the task it has to accomplish.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi e6bdae206e pypeline: notifications a duty of StorageProvider
Make the issuing of notification completely out of band with respect to
the `Pipeline`. Now the `StorageProvider` is responsible for providing
notifications to clients. Since some providers are local-only, there is
a `LOCAL_QUEUE` which allows sensing notifications through a local
queue, re-using the local revng daemon.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi b7f914d53f StorageProvider: move invalidate into set_model
Make `set_model` perform both the invalidation and the changing of the
model bytes. This makes persisting the result of an analysis to storage
atomic.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 2fabd9c400 pypeline: split Pipe.invalidate in two
Split the `invalidate` method in two phases: in `invalidateCheck` it
just checks if the model diff warrants the execution of the actual
`invalidate` method, which requires fetching the custom invalidation
data from storage. The actual `invalidation` method remains the same.
This should make invalidation faster for storage providers that store
the invalidation remotely.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi a68c53cbb0 pypeline.cli: drop PypeGroup
The `PypeGroup` click group did not provide any real benefit:
* It added extra help about pipebox arguments, but text that was not
  correct from where the help was coming from (the group does not parse
  the arguments). The subcommands still reports it though.
* It forbid using non-PypeGroup and non-PypeCommand commands in the
  command tree, but in the long run this is desirable so it should be
  dropped
For these reasons it has been dropped.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi dc511987ed revng2 project daemon: propagate exception
When one of the tasks completes, it might be due to an exception, call
the `exception()` method so that the exception can actually be caught by
the try block.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi bff8b19ca7 Fix Model.identifier in the C++ implementation
Due to a missing `&` the identifier returned was `r` instead of `revng`.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 0f319057af pypeline-comparison: avoid sharing the input
When running pypeline comparison tests, copy the `$PWD` to an exclusive
scratch directory, which should eliminate any problems related to the
cache being shared across multiple projects.
2026-05-21 09:55:08 +02:00
Alessandro Di Federico ff5e97fcc2 Merge branch 'feature/python-3.14' 2026-05-20 10:58:42 +02:00
Giacomo Vercesi e8d6e48a1f pypeline-cli: fix logic for --format option
The `--format` option relied on `click.Context.get_parameter_source` to
determine if the default value for the `--format` parameter was passed.
A bug in click caused this to behave "correctly", click 8.4.0 fixed the
bug. Change the logic by using `None` as the default value so that it
can be checked without using the parameter source.
2026-05-19 10:41:18 +02:00
Giacomo Vercesi 3d6a1d3764 isort: fix behavior with black
Since isort 5.11.0 if a import statement ends with a trailing comma it's
excluded for sorting, which makes the black-formatted import lines
unformatted by isort. Disable this behavior in the config so all import
lines are sorted as they should.
2026-05-18 10:13:54 +02:00
Giacomo Vercesi 591e5b237a Fix check-convention errors
An upgrade in mypy made a type error show up in existing code.
2026-05-18 10:13:54 +02:00
Alessandro Di Federico cc17735e14 Merge branch 'feature/platform-roots-fixes' 2026-05-15 15:00:22 +02:00
Alessandro Di Federico 8e34aa3a3c revng-db: ensure CreateFileA is exported once 2026-05-15 11:43:22 +02:00
Alessandro Di Federico a225d26fa2 import-prototypes-from-db test: import ARM test 2026-05-15 11:43:22 +02:00
Alessandro Di Federico 9bc1e65125 import-prototypes test: merge .yml and .filecheck 2026-05-15 11:43:21 +02:00
Alessandro Di Federico 723e4ead76 export sqlite: ignore symbols without a prototype 2026-05-15 11:43:11 +02:00