Commit Graph

2544 Commits

Author SHA1 Message Date
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
Lauri Vasama 37b8cc7771 Add MutableStringAttr 2025-09-29 18:05:54 +03:00
Lauri Vasama 94ba300f2d Add inherent handle attributes on local and label 2025-09-29 18:05:54 +03:00
Lauri Vasama b1b6a0e93c Add Location conversion utilities 2025-09-29 18:05:54 +03:00
Lauri Vasama 375d40fc59 Move CTarget.h under revng/Support 2025-09-29 18:05:54 +03:00
Lauri Vasama eb45307fb4 Fix pipeline::Location::back 2025-09-29 18:05:54 +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
Andrea Gussoni 92e8ec3982 ScopeGraphUtils: improve isDAG check
We now ensure that even in case of blocks disconnected from the entry,
the `isDAG` function still search for loops in such parts of the graph.

This is achieved by instantiating multiple `scc_iterator` on the blocks
composing the underlying `Graph`.
2025-09-26 10:39:09 +02:00
Andrea Gussoni 08781ab2a6 GraphAlgorithms: hasUnreachableBlocks helper
Introduce the `hasUnreachableBlocks`, which can be used to test that
blocks disconnected from the entry of the `GraphT` do not exists.
2025-09-24 15:51:06 +02:00
Andrea Gussoni 817c5c0e23 GraphAlgorithms: propagate template arguments 2025-09-24 15:51:02 +02:00
Giacomo Vercesi 448f70e7dc Add trace runner
Add the tool `pypeline-trace-runner` which allows reading a serialized
pypeline schedule and execute it purely in C++.
2025-09-17 14:09:16 +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 c68b7f1ab6 TupleTreeGenerator: make all keys hashable
Make all `Key` structs generated by TupleTreeGenerator have a
`std::hash` specicialization.
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 385cbfb13a Introduce ModuleSlotTracker-aware dumpToString 2025-09-10 17:44:02 +02:00
Ivan Krysak 4d35551f14 Introduce a debug information preservation style
It's guarded behind the
`EnableStrictDebugInformationPreservationStyle`
option.
2025-09-10 17:44:02 +02:00
Ivan Krysak f1ee21c2cd Introduce isDebugLocationInvalid helper 2025-09-10 17:44:01 +02:00
Ivan Krysak 2ad2cbda6f setInsertPointToFirstNonAlloca: preserve DebugLoc 2025-09-10 17:44:01 +02:00
Andrea Gussoni d010ab806d MLoopScopes: introduce pass
The `MaterializeLoopScopes` is a scope-inducing transformation, with the
goal of inserting a `scope_closer` edge targeting the immediate post
dominator, outside each `GenericRegion`, in order to materialize the
scope representing the body of each `GenericRegion` on the `ScopeGraph`.
2025-09-10 13:36:09 +02:00
Andrea Gussoni fbd8c827e1 ScopeGraph: move helper functions
Move the `replaceSuccessors` and `simplifyTerminator` helper in the
`ScopeGraphUtils` library.
2025-09-10 13:36:08 +02:00
Andrea Gussoni f0ef0947a2 GenericRegion: fix getParent return type 2025-09-10 13:36:08 +02:00
Andrea Gussoni 53b756d169 GenericRegionPass: run on the ScopeGraph 2025-09-10 13:36:08 +02:00
Giacomo Vercesi c2afb05049 VerifyHelper: set ReasonBuffer with simple str
When using `maybeFail(bool, llvm::Twine)` the `ReasonBuffer` variable
was not being set, leading sometimes to the verify reason being an empty
string.
2025-09-09 12:27:33 +02:00