Giacomo Vercesi
6bb745ddfb
InitRevng: fix memory leak due to stack trace
...
When initializing `revng::InitRevng` it is assumed by its parent,
`InitLLVM`, that the lifetime of `Argv` and be equivalent to
static, because it might be later retrieved to print it in case of a
crash. This works with the traditional `main`, however in the pipebox
the string passed are not guaranteed to have that lifetime. This commits
moves ownership of the strings to a class that stores them to avoid this
problem.
2025-12-11 17:21:37 +01:00
Giacomo Vercesi
f7231a29da
Add yield-cfg to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
255748228a
Add yield-call-graph-slice to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
4385f28c17
Add YieldCallGraph to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
9a202822f1
Add ProcessCallGraph to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
a8ed75fdb1
Add CleanupIR to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
d80c0a73f6
Add MergeLLVMModules to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
05dc279ef2
Add emit-c-as-single-file to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
e260d05082
Add EmitC to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
9b527c8b69
Add ImportModelNames to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
cfe476c701
Add ModelVerifyClift to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
75455a339e
Add PureMLIRPassesPipe to pypeline
...
In the same vein as `PureLLVMPassesPipe`, add a pipe to pypeline that
allows running arbitrarily-specified MLIR passes that do not depend on
the model.
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
97fe9203e1
Add LLVMToClift to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
08154335e3
Add SwitchToStatements to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
ee1fdebc4e
Add SegregateStackAccesses to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
3cd011c146
Introduce CliftFunctionMixin
...
In equivalence with `LLVMFunctionMixin`, add a mixin that allows
writing a pipe that instead of defining the `runOnFunction` method it
defines the `runOnCliftFunction` which receives both the
`module::Function` and the `FunctionOp`.
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
16e89416c5
Add CliftFunctionContainer
...
Add a container that owns one `mlir::ModuleOp` per function, to be used
in conjunction with the new clift backend.
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
e35f5750de
Add ConvertFunctionsToCABI analysis to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
9e8e4cdf85
Add AnalyzeDataLayout analysis to pypeline
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
56ab47bfd2
Outline mergeBackImpl in IRHelpers
...
Move the body of `LLVMContainer::mergeBackImpl` in
`Support/IRHelpers.cpp` under the name `linkFunctionModules`.
2025-12-10 16:16:14 +01:00
Giacomo Vercesi
5a6efb0fa2
Add DetectStackSize analysis to pypeline
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
c1217dcfc3
Add DetectABI analysis to pypeline
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
405733369b
Add ImportWellKnownModelsAnalysis to pypeline
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
47038d46ec
Add ParseBinaryAnalysis to pypeline
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
e4e259df3c
Add MakeSegmentRef to pypeline
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
3e37058899
Add LegacySegregateStackAccesses to pypeline
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
3a08f8713b
Add SimplifySwitch to pypeline
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
c0e8c8fa09
Add PromoteStackPointer to pypeline
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
10cc709098
Add InjectStackSizeProbesAtCallSites to pypeline
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
0bc74e0234
Add PromoteInitCSVToUndef to pypeline
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
e13e5add06
Add RemoveLiftingArtifacts 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
db94859401
Registrars: add Run suffix for piperuns
...
Change the `Register.*Pipe` functions to end in `Run` if the template
argument should be a pipe run. Also change the concepts `Is.*Pipe` to
also have the `Run` suffix if applicable.
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
296eb9a76f
Make SingleOutputPipe uniform to other piperuns
...
Make the interface required by `SingleOutputPipe` similar to other
piperuns by requiring a constructor, the use of `PipeRunArgument`s and
the implementation of a non-static `run` function.
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
532a4a19f6
Drop LLVMFunctionPassPipe
...
Drop the `LLVMFunctionPassPipe` as it will not be used in the pipeline
by any pipe and its infrastructure is not needed.
2025-12-10 15:05:53 +01:00
Giacomo Vercesi
1da6e49b36
ObjectDependenciesTracker: also stop tracking
...
Call `revng::Tracking::stop` in the destructor of
`ObjectDependenciesTracker` to avoid tracking happening after the object
is destroyed.
2025-12-10 15:05:53 +01:00
Lauri Vasama
21a51af54f
Add immediate radix deduction pass
2025-12-05 19:53:41 +02:00
Lauri Vasama
33450e9306
Add terminal-branch-complement-hoisting pass
2025-12-05 19:53:41 +02:00
Lauri Vasama
73d7a77442
Add expression rewrite pass
2025-12-05 19:53:41 +02:00
Lauri Vasama
0f04483517
Add statement rewrite pass
2025-12-05 19:53:41 +02:00
Lauri Vasama
448276915e
Add label-merging pass
2025-12-05 19:53:41 +02:00
Lauri Vasama
f2911da190
Add trivial-return-elimination pass
2025-12-05 19:53:41 +02:00
Lauri Vasama
58216deafd
Add RewriteHelpers.h
...
Contains helpers for statement rewriting.
2025-12-05 19:53:41 +02:00
Lauri Vasama
c835baf65a
Add PatternRewriter.h
...
Contains APIs from upstream LLVM that are not yet present in the current
version, as well as helpers not present in upstream.
See upstream commit 42c31d8302ff8f716601df9c276a5cd9ace6b158.
2025-12-05 19:53:41 +02:00
Lauri Vasama
ba945442d6
Add BlockStatementOp
2025-12-05 15:01:14 +02:00
Lauri Vasama
8599cc0c1d
Add StatementRegionOpInterface
...
This interface describes any operation containing statement regions.
2025-12-05 15:01:14 +02:00
Lauri Vasama
adcbdf4524
Add clift::getPrimitiveIntegerType
2025-12-05 15:01:14 +02:00
Alessandro Di Federico
1dff54ba60
Make new backend independent from the old one
2025-12-03 17:59:18 +01:00
Alessandro Di Federico
896bb8d523
Drop SegregateStackAccessesPass.h
2025-12-03 17:59:18 +01:00
Alessandro Di Federico
8f19f5292c
Minor changes
2025-12-03 17:59:18 +01:00