This commit reworks the helper methods for model::QualifiedType, to
properly traverse typedefs.
These methods are used to check if a QualifiedType is:
- scalar
- primitive
- float
- void
- pointer
- array
This commit add the methods for checking pointers and arrays (that
weren't available before), reworks all the helpers so that they all
traverse typedefs, and adds comments so that it's clear that they
traverse typedefs.
This commit adds the static methods:
- model::Qualifier::isConst
- model::Qualifier::isArray
- model::Qualifier::isPointer
These methods replace the old, non-static, methods:
- model::Qualifier::isConst
- model::Qualifier::isArray
- model::Qualifier::isPointer
Having these method static is very helpful for filtering, when
iterating on sequences of qualifiers, such as:
for (const auto &Q :
llvm::make_filter_range(Qualifiers, Qualifier::isPointer)) {
// do stuff with Q
}
This will be very helpful for defining other helper functions for
model::QualifiedType.
This commit also drops the non-static version of the methods, since they
are redundant, and because they would cause ambiguity and failure of
type inference in the snippet above, making them effectively useless for
the goal they were designed for, which is filtering ranges.
We used to collect all binaries into the `bin/` directory. However this
led to confusions since certain commands where available both as
`revng-command` and `revng command`.
This commit moves all the executables except `revng` into
`libexec/revng`, which, according to FHS, is dedicated to "internal
binaries that are not intended to be executed directly by users or shell
scripts".
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
1. Hoist the logic to retrieve a model CallEdge from an llvm::CallInst
out of `getCallSitePrototype()`, in a separate `getCallEdge()`
function.
2. Modify `getCallSitePrototype()` so that the parent function's type is
optional.
Inject is meant to inject a model into an `llvm::Module`, but it fails
when operating on a Module that had no model metadata.
This commit fixes the bug.