If we find values to be used outside their scope, we need to always
mark them for assignment, so that they have a dedicated variable that
is declared in the right scope. To do this we:
1. Export the logic that decides if a value needs a top-scope variable
in a public header, to be used by both `VariableScopeAnalysis` and
`MarkAssignments`.
2. Add the `HasUsesOutsideBB` reason for assignment markers
`DecompileFunction` now handles the opaque `parentheses` and
`ModelCast` markers as part of beautifying the decompiled code
with proper parenthesized expressions. Should OPRP not be enabled,
we fallback to the case in which parentheses are always emitted.
Before this commit we were using a suboptimal API that often resulted in
expressions with many zeros for the 0 constant, e.g. 0000000 instead of
just 0.
This commit fixes the problem.
The beautification library was split into a separate library for
historical reason, having to do with LLVM passes, their dependencies,
and dirty hacks we had around.
Now the LLVM passes, and the hacks are gone, so we can merge back
everything together.
Now that the late stage of the decompilation pipeline is managed with
revng-pipeline, and we have a standalone tool for decompilation, we
have no need to use LLVM passes anymore for those stages.
This commit also renames the directories to avoid the confusing Pass
suffix, not what LLVM passes are gone.
This commit replace the old CBackendPass with a standalone tool:
revng-decompile.
This pass at the moment runs the three stages of decompilation:
- CFG restructuring
- Beautify GHAST
- C Code generation
This library replaces the old AddIRSerializationMarkers, cleaning up a
lot of historcal baggage, merging Liveness and MarkAnalysis, and
adopting a more accurate naming across all the codebase.