Commit Graph

6113 Commits

Author SHA1 Message Date
Alessandro Di Federico fa3206b26d Rename Lifted tag to Isolated 2022-03-17 14:10:50 +01:00
Alessandro Di Federico ea6383c476 mv {d,registerD}efaultFunctionPrototype 2022-03-17 14:10:50 +01:00
Alessandro Di Federico df00a892dd Introduce revng.cli.lift 2022-03-17 14:10:50 +01:00
Alessandro Di Federico da7701bd4e Move all executables except revng to libexec/revng
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".
2022-03-17 14:10:50 +01:00
Alessandro Di Federico 4f1600faf9 Adopt revng_add_test_executable 2022-03-17 14:09:33 +01:00
Alessandro Di Federico 77335d036a Rename Lifted tag to Isolated 2022-03-17 14:08:05 +01:00
Alessandro Di Federico d9b8d49cca Use -- for pass names 2022-03-17 14:07:22 +01:00
Alessandro Di Federico 0e387938be Move scripts/revng to revng/cli/revng.py 2022-03-16 22:10:15 +01:00
Alessandro Di Federico 997e7f60cb scripts/renvg: handle revng pipeline
Let `scripts/revng` intercept `revng-pipeline` invocations and add, not
only -load, but `-P` (pipelines) too.
2022-03-16 22:10:15 +01:00
Alessandro Di Federico bc8e6a6a24 Minor changes 2022-03-16 22:10:15 +01:00
Pietro Fezzardi 9d14e672e7 Merge feature/drop-caliban into develop 2022-03-16 16:57:16 +01:00
Pietro Fezzardi 35cd9bbf4a Drop function decompilation API
The only user of the API was caliban, which is now officially
unsupported.
2022-03-16 16:57:05 +01:00
Pietro Fezzardi d98f495938 Drop unit tests for function decompilation API
The only user of the per-function decompilation API was caliban, which
is now officially unsupported.
2022-03-16 16:57:05 +01:00
Alessandro Di Federico edaf468c7c Merge branch 'feature/dematerialize-revng-lift' 2022-03-11 15:37:21 +01:00
Alessandro Di Federico 7d48059800 Turn revng-lift into a script 2022-03-11 15:37:12 +01:00
Alessandro Di Federico 0793e4afcb Turn lifting into a pass 2022-03-11 15:37:12 +01:00
Alessandro Di Federico 5e38805063 Rename detail namespaces into revng::detail 2022-03-11 15:37:12 +01:00
Pietro Fezzardi ff0a1b8eab DLADeduplicateUnionFields.cpp: fix linkOrderLess
The linkOrderLess comparison function is used for sorting the children
edges of a node.

Before this commit, it could not handle the case of comparing an edge
with itself, yielding wrong results (or assertion failure if assertions
were compiled in).

This commit fixes linkOrderLess to handle that case without asserting,
and adds an early return for it, without requiring to inspect the edges
in depth.
2022-03-10 18:00:05 +01:00
Alessandro Di Federico 5d197bff15 Adopt API changes in the model 2022-03-10 17:59:05 +01:00
Alessandro Di Federico 857f3afcf6 Merge branch 'feature/reorganize-frontend' 2022-03-10 15:54:53 +01:00
Pietro Fezzardi 3b999b378d Merge feature/dla-bugfixes into develop 2022-03-10 12:23:22 +01:00
Pietro Fezzardi a8da5e14ec DLA: enable union dedup w/o CollapseSingleChild
DeduplicateUnionFields does not depend on CollapseSingleChild, but can
break if CollapseSingleChild has not run.
However, we don't want to introduce an explicit dependency between the
two steps, because CollapseSingleChild could soon become obsolete on
its own, superseeded by a more powerful and costly step.

This commit changes DeduplicateUnionFields with an additional
pre-processing that runs CollapseSingleChild on each node at step one,
to ensure the step does not fail if CollapseSingleChild child is not
executed.
2022-03-10 12:21:01 +01:00
Alessandro Di Federico cd7f1fced5 Update test results 2022-03-08 20:57:46 +01:00
Pietro Fezzardi acef606a73 DLATypeSystem.cpp: improve error reporting 2022-03-08 17:21:24 +01:00
Pietro Fezzardi 8e3b1c0080 DLACollapseSingleChild: preserve InterferingInfo 2022-03-08 17:21:08 +01:00
Pietro Fezzardi 3546eda055 DLATypeSystem.cpp: improve .dot for Instance edges 2022-03-08 17:20:49 +01:00
Pietro Fezzardi 9a6a0369e7 DLADeduplicateUnionFields.cpp: fix log 2022-03-08 17:20:32 +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
Alessandro Di Federico e9b1879067 Handle invalid model::DynamicFunction::Prototype 2022-03-08 15:04:34 +01:00
Alessandro Di Federico ad7e6d9388 EFA: always perform stack adjustment 2022-03-08 15:04:34 +01:00
Alessandro Di Federico 60cce26768 Support streaming llvm::Errors to Loggers 2022-03-08 15:04:34 +01:00
Alessandro Di Federico 0a5d2c04a7 Rework LoadModelPass 2022-03-08 15:04:34 +01:00
Alessandro Di Federico 1a57229693 Introduce model::Binary::DefaultPrototype 2022-03-08 15:04:34 +01:00
Alessandro Di Federico b3bfd5c64d Introduce RawBinaryView 2022-03-08 15:04:34 +01:00
Alessandro Di Federico 1d1ae3f7d4 Add model::Binary::ExtraCodeAddresses 2022-03-08 15:04:34 +01:00
Alessandro Di Federico 7a35ef21be Extend model::Register
This is done in order to get rid of `BinaryFile`.
2022-03-08 15:04:29 +01:00
Alessandro Di Federico b65dc65037 Extend model::Architecture
This is done in order to get rid of `BinaryFile`.
2022-03-08 13:06:49 +01:00
Alessandro Di Federico a88a9e52c3 Improve model::Segment 2022-03-08 13:06:47 +01:00
Alessandro Di Federico 97f0941aee Introduce model::Section 2022-03-08 12:26:07 +01:00
Alessandro Di Federico 8570923d64 Introduce model::Relocation 2022-03-08 12:25:59 +01:00
Alessandro Di Federico 69cd0db81f tuple_tree_generator: make Key strongly typed 2022-03-08 12:25:47 +01:00
Alessandro Di Federico 39ace7dc56 mv revng{DwarfImporter,ModelImporterDwarf} 2022-03-08 12:25:47 +01:00
Alessandro Di Federico 81f21ae21d Make model::Binary::EntryPoint optional 2022-03-08 12:25:47 +01:00
Alessandro Di Federico 1cd17a13e8 readFromPointer: use bool IsLittleEndian 2022-03-08 12:25:47 +01:00
Alessandro Di Federico 75b5620703 Introduce OverflowSafeInt 2022-03-08 12:25:47 +01:00
Alessandro Di Federico f44363f621 Introduce TemporaryFile 2022-03-08 12:25:47 +01:00
Alessandro Di Federico 0589697dca CMake: sort headers for tuple_tree_generator 2022-03-08 12:25:35 +01:00
Alessandro Di Federico af79107b8b Move Integral concept to Concepts.h 2022-03-08 12:25:35 +01:00
Alessandro Di Federico 7c515ff997 Use std::string for MaterializedValue::SymbolName 2022-03-08 12:25:35 +01:00
Alessandro Di Federico c1ed018786 Fix a revng_assert meant to be a revng_abort 2022-03-08 12:25:22 +01:00