Commit Graph

17 Commits

Author SHA1 Message Date
Antonio Frighetto ab4bdf398d EFA: leverage ABI-specific layer
Architecture-agnostic results provided by EarlyFunctionAnalysis
are refined through an ABI-specific layer.
2022-04-15 18:25:11 +02:00
Antonio Frighetto 9980fc8c67 EFA: support dynamic function calls
EarlyFunctionAnalysis now can handle calls to
dynamically linked functions.
2022-04-05 15:37:57 +02:00
Antonio Frighetto 499a837aac EFA: take a const model in Analyzer constructor
EarlyFunctionAnalysis now takes a `const TupleTree<model::Binary> &`
as part of `Analyzer` constructor, `finalizeModel` method excepted,
since it needs to write into the model.
2022-04-05 15:37:57 +02:00
Antonio Frighetto d6a1611c0a EFA: full ABI analysis or CFG collection only
EarlyFunctionAnalysis now can be invoked to schedule a full
ABI analysis over the collected functions via `--detect-abi`
option, or it can limit itself to simply recover the CFG and
serialize it onto the LLVM IR via `--collect-cfg` option.
2022-04-05 15:37:57 +02:00
Antonio Frighetto 20cdfe668a EFA: take the control-flow graph out of the model
The control-flow graph and all its hierarchy components
have been moved from `model` to `efa`. The CFG is now
serialized onto the LLVM IR module as a metadata.
2022-04-05 15:37:57 +02:00
Antonio Frighetto 98b79766be EFA: initialize cache by loading from model
The results of the model are loaded into the EarlyFunctionAnalysis
cache, and only those functions which are not in the model have
an EarlyFunctionAnalysis scheduled. The model is updated appropriately.
2022-04-05 15:37:57 +02:00
Antonio Frighetto ddc7fede5a EFA: optimize cross-call site propagation
Take advantage of directly iterating over the call-sites of a
function and perform the cross-call site merge, instead of
iterating over all the functions for each function.
2022-04-05 15:37:57 +02:00
Antonio Frighetto 08b790329a EFA: fix end address of a jump target
EarlyFunctionAnalysis was considering jump targets as part of the
current basic block, thus computing the final address erroneously.
2022-04-05 15:37:57 +02:00
Antonio Frighetto 12d8b1f222 EFA: remove reference template parameter
Code simplification to lighten the syntax.
2022-04-05 15:37:57 +02:00
Antonio Frighetto aae31a3a05 Introduce function entry-points collection passes
The collection of the function entry-points has now been separated
from EarlyFunctionAnalysis into two distinct passes: the first one,
which collects functions which are in call-sites of a direct call,
and the second one which collects code pointers in `.rodata` (e.g.,
function pointers, vtables; jump-tables are possibly skipped).
2022-04-05 15:37:57 +02:00
Antonio Frighetto c5b3fc4405 Rename ABIRegisters to ABICSVs 2022-04-05 15:37:57 +02:00
Antonio Frighetto 7ace65adad Drop old CFEP notation 2022-04-05 15:37:57 +02:00
Alessandro Di Federico ee0b8f44c1 Introduce BinaryImporter
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
2022-03-08 15:15:24 +01:00
Alessandro Di Federico ad7e6d9388 EFA: always perform stack adjustment 2022-03-08 15:04:34 +01:00
Ivan Krysak 9771ae29d6 Move RegisterState to ABI 2022-02-14 13:35:37 +01:00
Filippo Cremonese 74217b4fe5 Generate C++ model from YAML definition
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.
2022-01-13 14:34:11 +01:00
Antonio Frighetto 10f45c593a Move StackAnalysis to EarlyFunctionAnalysis 2021-12-15 18:03:30 +01:00