When creating the DLA graph, we want to avoid inserting `instanceOf`
edges with huge offsets, so we set a limit to 64K.
This is a workaround to handle cases in which we make wrong decisions
about the base address of a SCEV expression. One of the situations in
which this occurs are expressions such as `&val + BIG_CONST`, for which
we always identify `%val` as the address and `BIG_CONST` as the offset.
When fixing this case, we should still verify that this never happens.
Calls to `OpaqueExtractValue()` are meant to replace `extractvalue`s
found in the LLVM IR. Since the type of an `OpaqueExtractValue` is
identified by both the return type (extracted value) and the first
argument's type (aggregate operand of the `extractvalue` instruction),
we need to consider both when building the associated FunctionPool.
Previously, we were identifying each `OpaqueExtractValue` variant using
only the returned value, which was wrong. In fact, if we have two
`extractvalue` instructions that extract a value of the same type
(e.g. i32) from two different aggregate types (e.g. structA and
structB), we have to define two different `OpaqueExtractValue`: one
that returns an i32 and has a parameter of type structA, and one that
returns an i32 and has a parameter of structB. If we use only the
return type, we are not able to distinguish the two.
This commit adds the newly implemented functionality in PipelineC both
in revng.api and the graphql api, allowing:
* retrieval of global variable names
* unwrapping of a single target
* execution of analyses
Moving it was causing the address of the model to change, while for the
functionality of revng-pipeline we need it to be stable.
So we pay the price of expensive copy, for the sake of downstream
stability.
The copy of a TupleTree is potentially very expensive, so it was
disabled until now and only allowed via the explict method clone().
We have now decided to make TupleTree copiable.
This commit adds a copy-constructor and a copy-assignment, killing the
clone() method that was already unused and is now effectively useless.
This commit introduces a reusable function to compact
pipeline::TargetLists that represent functions.
Initially this reasoning was only needed by TaggedFunctionKind, but now
also FunctionStringMap needs it, and potentially others in the future,
so it makes sense to keep only a single implementation for it instead of
duplicating code (and likely bugs).
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 is necessary because now QualifiedType.h needs TypeKind, but
including Type.h directly would result in a circular dependency between
Type.h and QualifiedType.h
This flag was used with the old C backend to decompile only a single
function from a binary.
The logic of selecting functions in a binary for decompilation is now
part of revng-pipeline, so the -single-decompilation option and the
associated TargetFunctionOption library can be dropped.