Commit Graph

18 Commits

Author SHA1 Message Date
Pietro Fezzardi a4dc1e52fd EnforceABI: add FunctionTags::ABIEnforced tag 2022-04-12 14:15:01 +02:00
Pietro Fezzardi 69d65956bf PromoteCSV: add FunctionTag::CSVsPromoted tag 2022-04-12 14:14:19 +02:00
Alessandro Di Federico 1a2a729e92 Rework FunctionTags::Tag 2022-03-31 12:51:24 +02:00
Alessandro Di Federico 00ce580362 Introduce EnforceABI and PromoteCSV pipes 2022-03-17 14:10:50 +01:00
Alessandro Di Federico fa3206b26d Rename Lifted tag to Isolated 2022-03-17 14:10:50 +01: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
Alvise de Faveri 7593d4da23 PromoteCSVs: promote PC CSVs 2022-02-12 12:04:14 +01:00
Alessandro Di Federico 7c050ee377 mv include/revng/{TypeShrinking,MFP}/SetLattices.h 2021-12-17 18:51:06 +01:00
Alessandro Di Federico 3e1e69e08f Introduce eraseFromParent 2021-12-17 18:50:08 +01:00
Alessandro Di Federico 4b6a557a19 Fix key issues in -promote-csv
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.
2021-12-17 18:49:51 +01:00
Antonio Frighetto cbd81e57d9 Improve MFP 2021-12-15 18:03:30 +01:00
Antonio Frighetto b5f87748eb PromoteCSVs: no wrapper for Marker and Exceptional 2021-12-15 18:03:30 +01:00
Alvise de Faveri 267410ac43 Add Attribute::WillReturn to ReadOnly funcs
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.
2021-11-19 10:17:02 +01:00
Alessandro Di Federico 3a3eea0cf5 Introduce support for dynamic functions 2021-10-21 15:01:19 +02:00
Alessandro Di Federico 06043b92c6 PromoteCSV: do not promote the stack pointer 2021-10-18 20:44:58 +02:00
Pietro Fezzardi f0a6184ac0 Propagate DebugLoc on CallInst and InvokeInst
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.
2021-06-14 23:04:02 +02:00
Pietro Fezzardi b6327b0526 PromoteCSVs: fix CSV list initialization 2021-04-30 14:52:25 +02:00
Alessandro Di Federico 53f6328507 Introduce PromoteCSVs
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.
2021-04-22 18:07:24 +02:00