The `ptml` namespace contains utilities for easier PTML manipulation.
These include:
* A few constants (e.g. standard attributes) available in
`revng/PTML/Constants.h`
* The `Tag` class to easily construct html/xml tags with attributes
without having to use format strings.
* The `PTMLIndentedOstream`, a llvm::raw_ostream wrapper that
automatically adds tagged indentation to the output
`Segment` now includes a `Type` of struct kind. This is intended to
emit the segment as a struct later in decompilation. The implementation
of name has also been added.
A simple pass that scans constant expressions and literals and
replaces them with opaque calls so that they can be easily dealt
with by the Backend, in an attempt of emitting better-looking
decompiled code.
Add an engine for running VMA in different modes. User can:
- Decide how to initialize the colors (e.g. from the Model or from
the LLVM IR)
- Decide what to do with the final TFG obtained by VMA
- Decide whether or not the Mincut algorithm should run
1. Add a common helper to traverse ModelGEPs (`traverseModelGEP`)
2. Add a centralized way to deduce the model type of values that
have strong model information attached to them (e.g. isolated
functions and ModelGEPs)
3. Add a similar helper for deducing formal types of operands in known
cases
A step's artifacts now include singleTargetFilename, which gives a
suggested filename to use when a single element is extracted from the
underlying container.
`recalculateAllPossibleTarget` is now a private member of
PipelineManager This was done since all calls that can trigger a change
in the target list have been isolated and the call is done implicitly.
This removes rp_manager_recompute_all_available_targets from PipelineC,
since it was added as a stopgap until the above was implemented.
This commit introduces some changes to how the revng pipeline handles
serializing to disk. Specificaly:
* Pipeline globals (specifically model.yml) are better handled if they
are in a subdirectory. They are now saved in the "context"
subdirectory.
* In python:revng.api the pipeline is serialized whenever there is a
non-reproducible change to the state (e.g. binary upload or model
change).
In the case of analyses this is done conservatively by checking that
the diff produced is not empty.
* The logic for computing a step's subdirectory has been moved to the
pipeline runner, consequently if a step is asked to serialize it
will not create any subdirectories.
* Functionality for saving a single step/context has been exposed in
Pipeline C.
* Finally, all path concatenations are now handled by
llvm::sys::path::append, for extra os-agnosticism.
ModelGEP calls in LLVM IR now return an integer that has the same
size of the field being addressed by the ModelGEP.
AddressOf calls, instead, can accept any integer size as argument but
always return a pointer-sized integer.
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
Add `ReadsMemory` and `WritesMemory` Tags and restructure the
logic that decides whether two instructions are interfering
as follows:
1. Consider `Store`s and anything with a `WritesMemory` tag as
having side effects
2. Consider all the `TaintSet` of an instruction when deciding
if two instructions interfere
3. Consider both `ReadsMemory` and `WritesMemory` Tags when
deciding interference
We need to prevent stub kinds used just to represent dead elements to be
displayed in the GUI and CL.
We do so by introducing a DeadKind which expands their targets to the
empty list.
A simple pass that maps LLVM IR instructions to C operators,
taking into account their precedence and associativity to
emit nice-looking parenthesized expressions.
A pass that strips the casts off from some instructions, including
`ModelGEP`s, general function calls, return and store ones, and
embeds the cast into new dedicated `ModelCast` function calls.