PromteCSVs creates wrappers around helpers. These helpers used to return
a struct in case the helper was changing a CSV.
In order to simplify the downstream pipeline, we now use out arguments
instead of returning a struct.
This is a big step to split revng-lift in two parts: one that only
writes the model and one that actually lifts to LLVM IR.
* Introduce `revng import binary`
* Split off `BinaryFile.h`
* Drop `revng.h`
* `GeneratedCodeBasicInfo`: use model
* Reduce role of `GeneratedCodeBasicInfo` in favor of
`model::Architecture` and `model::Register` methods
* `CodeGenerator`: adopt `RawBinaryView` and model
* `JumpTargetManager`: adopt `RawBinaryView` and model
* `ExternalJumpsHandler`: adopt model
* `InstructionTranslator`: discard `Architecture` in favor of
`EndianessMismatch`
* Many other changes
The following bugs have been fixed:
* PromoteCSV no longer mixes `alloca` with other instructions, which is
a convention in LLVM IR that some passes rely upon.
* Before this commit, we were detecting if *calls to CSV initializers*
where already present in order to reuse them, but this was not right,
we need to reuse the *alloca* instructions they are associated
with. This commit does exaclty that.
Without this attribute, newer versions of llvm are not able to
remove calls to `ReadOnly` functions whose return value is unused.
This is instead the expected behavior for the functions that are
generated by `revng` with the `ReadOnly` attribute.
With llvm-12 thera are more stringent requirement on the propagation of
DebugLoc on CallInst and InvokeInst.
Various CallInst and InvokeInst created during lifting did not fulfill
these requirements, causing the Module to not verify() with llvm-12.
This commit fixes the problem, properly propagating the debug locations.
This commit takes out of EnforceABI the part taking care of creating
wrappers for calls to helpers and promoting CSV to local variables.
This decoupling, enables to run -promote-csvs multiple times, for
instance after inlining.