Commit Graph

268 Commits

Author SHA1 Message Date
Ivan Krysak 529b36a91c ADT: drop unused interfaces 2026-06-15 17:28:22 +02:00
Alessandro Di Federico d03e62c250 MFP: add ExtraState, MFPConfiguration, variant
Three closely-coupled changes that have to land together to keep
every caller compiling:

- Introduce a per-instance ExtraState recording surface (with a
  NoExtraState default) and thread it through applyTransferFunction.
- Replace getMaximalFixedPoint's positional arg list with a single
  MFPConfiguration struct, so callers spell out only the fields they
  need.
- Replace the EntryLabels pointer with an Entry/All/vector* variant
  so callers can ask for the graph entry, every node, or a custom
  list without juggling extra arguments.

Update every existing caller for the new signatures and switch
Liveness::GraphType to a plain Function* (with the inverse
GraphTraits selected at call sites).
2026-06-11 17:39:53 +02:00
Alessandro Di Federico 2a2ef04ec0 Minor changes
Comment refresh, formatting and small no-op tweaks across unrelated
files.
2026-06-11 17:39:52 +02:00
Lauri Vasama 5b13b6948c Add ScopedExchange::commit to persist the mutation 2026-04-30 15:09:16 +03:00
Alessandro Di Federico 63851e2f57 Introduce IndexedVector 2026-04-23 13:40:42 +02:00
Alessandro Di Federico 6e5462b3c9 replaceAll: return true if changes are made 2026-04-23 13:40:42 +02:00
Alessandro Di Federico ee9c77b719 appendTo: move to STLExtras.h 2026-04-23 13:40:42 +02:00
Lauri Vasama 9c76e1219f Add ADT/LineRange.h 2026-04-09 18:37:46 +03:00
Ivan Krysak 1a91707a2b GenericGraph: introduce empty() method 2026-02-25 14:10:44 +01:00
Ivan Krysak f0e00d66ab Do not use doxygen for TODOs 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
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 54b84de3ea CUniquePtr: add missing #include 2026-01-20 12:29:12 +01:00
Giacomo Vercesi 47038d46ec Add ParseBinaryAnalysis to pypeline 2025-12-10 15:05:53 +01:00
Giacomo Vercesi 19f67c8223 Introduce LLVMFunctionMixin
Add a mixin class for piperuns that work on an LLVM module and need
both the model function and the `llvm::Function`. Pipe that inherit this
mixin will receive both the model and LLVM function in the
`runOnLLVMFunction` method.
2025-12-10 15:05:53 +01:00
Giacomo Vercesi 1c07656448 pipebox.py: add initialize function
Add the `initialize` function to `pipebox.py`. This allows passing
command-line arguments to the pipebox.
2025-11-17 10:04:13 +01:00
Lauri Vasama 086dc9fbc9 Remove RecursiveCoroutine operator*
* Add rc_eval to force evaluation.
2025-10-31 17:23:52 +01:00
Lauri Vasama 429608d122 RecursiveCoroutine improvements 2025-10-31 17:23:52 +01:00
Lauri Vasama fb34338310 Add UniqueCoroutineHandle 2025-10-31 17:23:52 +01:00
Alessandro Di Federico db8eb227b9 TupleTreePath: rewrite with TraitfulAny 2025-10-28 09:18:27 +01:00
Alessandro Di Federico 4fb6b5f4e1 Minor changes 2025-10-24 18:20:48 +02:00
Giacomo Vercesi 2f83d8f5c9 Introduce CUniquePtr
Add a helper using of `std::unique_ptr` that allows easier wrapping of
C pointer with destructors.
2025-10-16 16:08:05 +02:00
Giacomo Vercesi d92f4cdca3 ObjectID: introduce byte (de)serialization
Add the `to_bytes` and `from_bytes` to `ObjectID`. This allows
serializing an `ObjectID` instance to raw bytes with a specific binary
format.
2025-10-15 11:58:41 +02:00
Giacomo Vercesi bb0709effc Introduce compile_time::callWithIndexSequence
Add a helper function that given a `size_t` or a tuple-like type, allows
calling a lambda with the expanded sequence pack. This avoids having to
manually create the index sequence and defining the lambda accepting it.
2025-10-15 11:58:41 +02:00
Ivan Krysak 4607741630 TrackingContainer: allow construction from T && 2025-10-13 18:33:10 +03:00
Ivan Krysak a8e326f4d7 UpcastablePointer: improve documentation 2025-10-13 10:26:41 +03:00
Ivan Krysak b6cb5c2ca3 UpcastablePointer: drop llvm::Error overload 2025-10-08 12:22:34 +03:00
Giacomo Vercesi 6d1fbdca97 Implement infrastructure for PipeRuns
Add the needed infrastructures that allow ephemeral classes (`PipeRun`s)
to be wrapped as a regular pypeline `Pipe` class. These automatically
have their dependencies tracked and propagated to the pypeline.
2025-10-03 17:40:45 +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
Ivan Krysak 2f560e797c TrackingContainer: introduce unwrap 2025-07-23 11:38:51 +02:00
Ivan Krysak 36ce22cd4e STLExtras: change notNull to return a reference 2025-07-23 11:38:51 +02:00
Ivan Krysak 04b751dafc TrackingContainer: add a missing Other access
This ensures `operator==` correctly registers the fact that *both*
of the containers were accesses.
2025-07-23 11:38:50 +02:00
Ivan Krysak d11b524f14 TrackingContainer: introduce operator<=> 2025-07-23 11:38:50 +02:00
Ivan Krysak 83a3843d8a SortedVector: introduce operator<=> 2025-07-23 11:38:50 +02:00
Andrea Gussoni 71988af041 Fix MIT license 2025-04-30 16:10:54 +02:00
Giacomo Vercesi 9ff471409e Remove some asserts from YAMLTraits
More soft-fails instead.
2025-04-28 12:58:27 +02:00
Ivan Krysak 7d409ab4a7 KeyedObjectContainer: support llvm::StringRef 2025-04-17 11:19:17 +03:00
Ivan Krysak 6c6cf04d11 STLExtras: rename is_contained_if into any_of
This improves consistency with the names llvm uses.
2025-04-15 16:35:42 +03:00
Ivan Krysak 0bd174c07f STLExtras: fix an ambiguous find_if call 2025-04-15 16:35:42 +03:00
Lauri Vasama c472dd3cae Move ScopedExchange to revng/ADT/ 2025-03-19 12:57:19 +02:00
Giacomo Vercesi 72d9b46e4b Error.h: improve joinErrors
Change the `joinError` functions to have stronger guarantees when used:
* Change the template signature to `RangeOf` to ensure that the
  container has `llvm::Error`s.
* Check that the size of the passed container is actually positive
  before deferencing `.begin()`.
2025-03-13 15:07:25 +01:00
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak d4ab801ab7 Rename range_with_value_type into RangeOf
Original name was reminiscent of the STL, but there's no such concept
in there, as such it's probably better to use revng naming convention
instead.
2025-02-13 13:09:50 +02:00
Ivan Krysak f5314e45d8 SortedVector: allow constexpr construction 2025-02-13 13:09:50 +02:00
Ivan Krysak 3b354f2590 TrackingContainer: allow comparisons with wrapped 2025-02-13 13:09:50 +02:00
Ivan Krysak 929cb4b35b Minor improvements 2025-02-13 13:09:50 +02:00
Pietro Fezzardi f81bbcc754 Add new EagerMaterializationRangeIterator
Introduce the `EagerMaterializationRangeIterator`, which substitutes the
`GeneratorIterator`, and is used to materialize the successors of a
node in the `ScopeGraph`.

In addition, remove the `GeneratorIterator`.
2025-01-15 11:48:28 +01:00
Andrea Gussoni fa69bd24e5 ScopeGraph: introduce the ScopeGraph
Introduce the `ScopeCloser` and `GotoTarget` annotations in the IR, and
the relative necessary machinery, needed to handle scope closer and goto
edges for the new backend.

A specialization of the `llvm::GraphTraits`, called `ScopeGraph`, that
is able to handle both the above mentioned annotations is provided.

For the `llvm::GraphTraits` implementation, we introduce the
`GeneratorIterator` class, which uses a coroutine to store the status of
the iteration.

A debug logger pass is added, so that we are able to test the
functionality with `FileCheck`.
2024-12-05 15:43:57 +01:00
Ivan Krysak 672ee5df50 Replace std::string_view with llvm::StringRef 2024-11-06 15:43:13 +02:00
Ivan Krysak 1eb80ecd2d Introduce an error creation helper 2024-11-06 15:20:37 +02:00