3016 Commits

Author SHA1 Message Date
Giacomo Vercesi 18f0bd88f9 pypeline::Model: fix serialize
The `serialize` function of `revng::pypeline::Model` erroneously
returned a buffer instead of `bytes`, fix the function so that `bytes`
are returned instead.
2025-10-16 12:51:52 +02:00
Giacomo Vercesi f165f99392 pypeline.Model: make deserialize to static
Change the `Model.deserialize` to a static function, which will return
a new instance of the Model.
2025-10-16 10:30:01 +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 10a396a3b5 PipeboxCommon: rework {Analysis,Pipe}Runner
Rework the `AnalysisRunner` and `PipeRunner` structs into single
functions, these do not need to have a template parameter specifying how
to extract containers as that logic has been delegated to a newly
introduced trait called `ExtractContainerFromList`.
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 ecb9d76c64 Model: drop obsolete default value handling 2025-10-13 18:33:10 +03:00
Ivan Krysak 855f929041 Yield: set default values where viable 2025-10-13 18:33:10 +03:00
Ivan Krysak 52e556f53e ABI: set default values where viable 2025-10-13 18:33:10 +03:00
Ivan Krysak a0cd3c78ca EFA: set default values where viable 2025-10-13 18:33:10 +03:00
Ivan Krysak fd1c9115c0 Model: set default values where viable 2025-10-13 18:33:10 +03:00
Ivan Krysak 4607741630 TrackingContainer: allow construction from T && 2025-10-13 18:33:10 +03:00
Ivan Krysak 782fb1d747 Yield: make TTG verification more strict
Some stuff that was before implicitly checked during deserialization
now need explicit checks, those are introduced here.
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 b38185c979 Model: rewrite TTG documentation
Big chunks of this file were outdated or otherwise awkward,
this brings it up-to-date with the current state of the TTG.
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 d9ee804211 Do not use std::vector in model TTG docs
Currently, using `std::vector` in these breaks invalidation, so to
avoid potential confusion, we shouldn't use it in docs either.

Note that it's fine to use `std::vector` in non-invalidation-enabled
TTG instances.
2025-10-13 18:33:10 +03:00
Ivan Krysak 0dba3e0c69 Yield: improve TTG-schema formatting 2025-10-13 18:33:10 +03:00
Ivan Krysak de6db68394 EFA: improve TTG-schema formatting 2025-10-13 18:33:10 +03:00
Ivan Krysak 89282f31da Minor improvements 2025-10-13 18:33:10 +03:00
Lauri Vasama 22d6f70ee2 Clift directory structure overhaul 2025-10-13 15:08:20 +02:00
Lauri Vasama 3c191122dc Rename Clift to CliftDialect, CliftOps to Clift 2025-10-13 15:08:20 +02:00
Ivan Krysak 25538385c8 Avoid using !! unless necessary
The only necessary place is when passing it into the  `BOOST_TEST`
macro, which doesn't convert its argument to `bool` internally.
2025-10-13 10:26:41 +03:00
Ivan Krysak a8e326f4d7 UpcastablePointer: improve documentation 2025-10-13 10:26:41 +03:00
Ivan Krysak e56f543b1a Split module.bc.zstd 2025-10-13 10:26:41 +03:00
Ivan Krysak 5717d835f8 Add missing llvm::Error checks 2025-10-13 10:26:37 +03:00
Ivan Krysak c11761ceb5 Pipes: drop unused invalidateFromDiff 2025-10-08 12:22:34 +03:00
Ivan Krysak 68d62428d8 Lift: drop free loadBinary function 2025-10-08 12:22:34 +03:00
Ivan Krysak d3bae70ba4 TupleTreeDiff: drop an unused overload 2025-10-08 12:22:34 +03:00
Ivan Krysak a88747cf99 Drop unused includes 2025-10-08 12:22:34 +03:00
Ivan Krysak d1fbf2eee6 Model: Drop ToolHelpers.h 2025-10-08 12:22:34 +03:00
Ivan Krysak b6cb5c2ca3 UpcastablePointer: drop llvm::Error overload 2025-10-08 12:22:34 +03:00
Ivan Krysak 77ea07c364 Minor improvements 2025-10-08 12:22:30 +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
Lauri Vasama 676fdfe0f5 Split common parts of Clift backend into new class
CEmitter contains utilities for emitting types, attributes and
declarations. These will be useful for generating headers from Clift.
2025-09-29 18:05:55 +03:00
Lauri Vasama 7fab96f119 Add dumpMlirModule for debugging 2025-09-29 18:05:55 +03:00
Lauri Vasama 18773ba22c Add Clift declaration attribute support 2025-09-29 18:05:55 +03:00
Lauri Vasama bf228a7c9b Reintroduce clift-opt emit-c transform 2025-09-29 18:05:55 +03:00
Lauri Vasama a50138998d Model agnostic Clift backend using CTokenEmitter 2025-09-29 18:05:55 +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 da638a9770 Rename ModuleValidator, extend visit interface 2025-09-29 18:05:55 +03:00
Lauri Vasama 6839ce4208 Add streaming CTokenEmitter interface 2025-09-29 18:05:55 +03:00
Lauri Vasama c3fd7d67a0 Add streaming ptml::Emitter interface 2025-09-29 18:05:55 +03:00
Lauri Vasama d339797ded Add Clift function op attribute helpers 2025-09-29 18:05:55 +03:00
Lauri Vasama b28ef38692 Add EnumType::getFieldByValue 2025-09-29 18:05:55 +03:00
Lauri Vasama 549fc933f1 Add handle parameters to fields and enumerators 2025-09-29 18:05:55 +03:00
Lauri Vasama c8b12be980 Implement FunctionType parsing in C++ 2025-09-29 18:05:55 +03:00
Lauri Vasama 1b3d74d031 Remove harmful Clift type and attribute builders
"Smart" builders that create other attributes internally have turned out
to be more trouble than they're worth. It's simpler to just use the
default builders with the parameters that are actually needed for
initialising the type or attribute.
2025-09-29 18:05:55 +03:00
Lauri Vasama d8ea0fc805 Add missing TypeDefinitionAttr on attributes
* Removed from field attribute where it does not belong.
2025-09-29 18:05:55 +03:00
Lauri Vasama 1ce6f256a7 Improve Clift local and global syntax 2025-09-29 18:05:54 +03:00