1. Add an `assets/` folder that contains:
- a file with all the flags used for recompilation
- a header file with portable float definitions
2. Restructure `CMakeLists.txt` so that all artifacts are generated
in separate folders, and all recompilation tests use the same
flags
Separate `ModelToHeader.cpp` into 3 different files:
1. DependencyGraph, used to calculate the precedence between
type declarations
2. ModelTypeNames, that holds all the naming logic, whose
primitives are accessible from other modules through a
public header
3. ModelToHeader, that now contains only the logic to print
out declarations and definitions
Also add a compilation test for the headers generated by this pass.
Before decompiling, we want to get rid of all unused stuff from the
IR. To do this, we have to:
1. Modify `FilterForDecompilation` so that it removes the body of
all non-isolated functions
2. Add `strip-dead-prototypes` to the preparation pipeline, so that
also the declarations of non-isolated functions that are not
directly called inside an isolated function are stripped from
the LLVM module. In this way, we can safely execute `HelpersToHeader`
**Symptoms**: a correct visit of the GHAST resulted in an incorrect
visit order of the CFG (some instructions were visited before their
operands)
**Causes**: When creating the tile of a dispatcher with an inline
successor and a fallthrough, the predecessors of the dispatcher
were correctly connected to the new tile, but the fallthrough
was not, leading to a split in the GHAST between nodes that should
have been connected
**Solution**: Setting `PostDomBB = Fallthrough` if there is a
fallthrough just before calling `createTile()` corrects
this behavior, connecting the tile to its fallthrough node
Run `matchWhile()` before `matchDoWhile()` in BeautifyGHAST.cpp.
Since `while` nodes cannot be transformed into `doWhile`s nor
vice-versa, this has the effect of giving priority to `while` loops
over `do-while`s in cases where you could emit both.
We should never be changing the nature of a `while` node into a
`doWhile` and vice-versa: we only upgrade standard nodes in
either a `while` or a `doWhile`.
This commit adds a bunch of type names and macro names to the set of
reserved keywords that cannot be used for names in the revng Model.
These are the names defined in the stdint.h standard C header, that is
included automatically by the decompiler in decompiled code.
We need to reserve these names otherwise it would be possible to add
things to the revng Model with names that clash with the names defined
in stdint.h, which would in turn break recompilation of decompiled code
because of conflicting definitions.
The revng-translate tool is now a driver for revng-pipeline to perform
the translation.
This commit also drops computing the `-load` "roots". It shouldn't
really be necessary.
This commit imports all the revng pipes (and other support utilities) to
be used with `revng-pipeline`. In particular, the pipes necessary for
binary translations have been introduced.