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 version of callOnPathSteps without an actual instance was completely
ignoring the upcasted type of `UpcastablePointer`s. We now fix this by
calling the right template specialization, which we choose by inspecting
the key of the `UpcastablePointer`.
Model classes are now described by a YAML document, which is used to
generate C++ headers containing classes and all the boilerplate
required for YAML serialization/deserialization, usage in
SortedVectors, etc. See the README in include/revng/Model for more
info.
A dereference iterator is used to map a pointer-like object to the
pointee, as an example given a `vector<unique_ptr<int>> Vector`, using
`dereferenceRange(Vector)` will present a range of `int &` rather than a
range of `unique_ptr<int> &`.
mapToValueIterator can be used on a map range
to access the underlying object directly rather
than the pair<key, object>.
This allows e.g. the following programming pattern:
```
RecursiveCoroutine<std::optional<SomeType>> f();
int g() {
return *f();
}
```
Without operator* defined for `RecursiveCoroutine` this would fail,
requiring an explicit cast such as:
```
int g() {
return *static_cast<std::optional<SomeType>>(f());
}
```
Before this commit `is_specialization<const X<T>, X>` was not
specialized, so that `const X<T>` did not count as a specialization of
`X`. This resulted in bad selection of template specialization based on
concepts that were using `is_specialization_v`, such as
`IsUpcastablePointer`.
This commit fixes the problem, so that now the concept
`IsUpcastablePointer` is true for `const UpcastablePointer<T>` as well.
This also enabled to remove some workarounds for the `IsMutableSet` and
`IsSortedVector` concepts, and treat them uniformly with other concepts
that were using `is_specialization_v`.
ConcreteTupleTreeKeyWrapper::clone() should cleanup the Target object
befor cloning, otherwise the destructor of the inner Pointer object
is never called.