Commit Graph

6113 Commits

Author SHA1 Message Date
Pietro Fezzardi 0e1402adfc Fix is_specialization<const X<T>, X>
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`.
2022-01-05 13:33:52 +01:00
Pietro Fezzardi 275959618f TupleTree: make Root a std::variant<T *, const T*>
This enables holding TupleTreeReferences to immutable model objects
2022-01-05 13:33:52 +01:00
Pietro Fezzardi 69715dafed TupleTreePath: add empty() method 2022-01-05 13:33:52 +01:00
Pietro Fezzardi c338e79de7 Extend TupleTreeCompatible concept
Before this commit, it was only matched by types that satisfied the
constraint `IsUpcastablePointer`, which is too strict.
Now also types that match `UpcastablePointerLike` satisfy the
constraints for this concept.
2022-01-05 13:33:40 +01:00
Pietro Fezzardi 3c7d46a294 DLAPass.cpp: drop useless include 2022-01-04 16:22:47 +01:00
Pietro Fezzardi 818156e06a DLA upgrades stack's and stack arguments' types 2022-01-04 16:21:07 +01:00
Alessandro Di Federico ed36d2b6ab Merge branch 'feature/convert-revng-lift-to-library' 2021-12-22 17:48:04 +01:00
Alessandro Di Federico 8c0b918ace s/DebugHelper.*/IRAnnotators.*/ 2021-12-22 17:47:54 +01:00
Alessandro Di Federico e7bc0c739b Restore emission of annotated IR 2021-12-22 17:47:54 +01:00
Alessandro Di Federico 88dbc39f29 Reorganize LLVM IR debug annotations emission 2021-12-22 17:47:54 +01:00
Alessandro Di Federico 6073133545 CodeGenerator: drop IR emission duties 2021-12-22 17:47:54 +01:00
Alessandro Di Federico 4d7a175996 Extract TupleTree 2021-12-22 17:47:54 +01:00
Alessandro Di Federico f97f8a880c Drop extra assertions related to debug info 2021-12-22 17:47:54 +01:00
Alessandro Di Federico 27b553f09e CodeGenerator: stop emitting .li.csv and .need.csv 2021-12-22 17:47:54 +01:00
Alessandro Di Federico 777adcbd45 model::Binary: add segments and imported libraries
Now, `scripts/revng` uses the model and we no longer need to emit
.li.csv and .need.csv.
2021-12-22 17:47:54 +01:00
Pietro Fezzardi decbbc56df Merge librevngcUtils into librevngcSupport 2021-12-22 17:46:45 +01:00
Pietro Fezzardi 53bb7ec263 Add -Wno-incompatible-library-redeclaration
This flag is now used for recompilation tests, to temporarily silence
failures caused by revng sub-optimal recognition of dynamic library
function types, that result in redeclarations that mismatch those
expected for system libraries.
2021-12-22 17:46:45 +01:00
Pietro Fezzardi 81336b9c78 Update #include directive due to renaming 2021-12-22 17:39:43 +01:00
Pietro Fezzardi 8a0d5108a2 Merge branch feature/detect-stack-size in develop 2021-12-22 14:17:05 +01:00
Alessandro Di Federico 5a28bfedea Move SegmentInfo::generateName to BinaryFile.cpp 2021-12-22 13:47:21 +01:00
Alessandro Di Federico 455bf10648 Specialize KeyedObjectTraits for std::string 2021-12-22 13:47:21 +01:00
Alessandro Di Federico 57ae7613e1 Drop obsolete debug files
This commit drops the generation of `.coverage.csv` and `.bbsummary.csv`
files. No one really uses them anymore.
2021-12-22 13:47:21 +01:00
Massimo Fioravanti 9e477d0ada Make a library out of revng-lift 2021-12-22 13:47:21 +01:00
Alessandro Di Federico 1ad2522240 Minor changes 2021-12-22 13:47:21 +01:00
Alessandro Di Federico 904684e2f5 Prefix all libraries with "revngc" 2021-12-22 13:43:21 +01:00
Alessandro Di Federico a1a145147c Merge branch 'feature/detect-stack-size' 2021-12-22 13:41:39 +01:00
Alessandro Di Federico 65e8923fcc GCBI::getSuccessors: relax assertion 2021-12-22 13:40:47 +01:00
Alessandro Di Federico 7c050ee377 mv include/revng/{TypeShrinking,MFP}/SetLattices.h 2021-12-17 18:51:06 +01:00
Alessandro Di Federico f1ce1f9980 compare-yaml: handle - as stdin 2021-12-17 18:50:57 +01:00
Alessandro Di Federico c64223a80c mv scripts/{,revng-}compare-yaml 2021-12-17 18:50:49 +01:00
Alessandro Di Federico 7cc2e914d7 compare-yaml: switch to grandiso.find_motifs
We need to use the `interestingness` in order to have good performance.
2021-12-17 18:50:41 +01:00
Alessandro Di Federico 101e7f7e09 compare-yaml: add attribute for references 2021-12-17 18:50:33 +01:00
Alessandro Di Federico fd08154452 compare-yaml: support negation 2021-12-17 18:50:25 +01:00
Alessandro Di Federico 786598d633 compare-yaml: ignore classes upon deserialization 2021-12-17 18:50:16 +01:00
Alessandro Di Federico 3e1e69e08f Introduce eraseFromParent 2021-12-17 18:50:08 +01:00
Alessandro Di Federico ddfa9ae767 getPointeeSize: assert bit size is divisible by 8 2021-12-17 18:49:59 +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
Alessandro Di Federico a2364bc6a0 GeneratedCodeBasicInfo: parse root lazily
This commit makes sure that GeneratedCodeBasicInfo can be used even in
absence of the `root`.

This also ensure that no time is wasted on brief/focused pipelines that
do not care about analyzing each basic block in the `root` function.
2021-12-17 18:49:42 +01:00
Alessandro Di Federico e113cb579e Introduce revng/Model/IRHelpers.h 2021-12-17 18:49:34 +01:00
Alessandro Di Federico 04633a21ca Tag call sites with CallToLifted 2021-12-17 18:49:26 +01:00
Alessandro Di Federico ec0e88351d model::Function: make CFG the last field 2021-12-17 18:49:17 +01:00
Alessandro Di Federico 9b05bfd2ba StackAnalysis: record FinalStackOffset 2021-12-17 18:49:09 +01:00
Alessandro Di Federico 8ead934c8e Improve scripts/compare-yaml
* Rename from compare-json.py to compare-yaml
* Handle YAML
* Support certain characteristics of the model
* Use subgraph matching to perform comparisons
* Introduce some testing
* Drop Python 2 support
* Reformat
2021-12-17 18:49:01 +01:00
Alessandro Di Federico 09914e56cf model::Type::dump: upcast 2021-12-17 18:48:52 +01:00
Alessandro Di Federico ca899c96f5 Debug output: pad before ] 2021-12-17 18:48:44 +01:00
Alessandro Di Federico 9a60a5fd82 Expand IRHelpers
* New `getCallTo` overloads accepting `Function *`
* `setInsertPointToFirstNonAlloca`
* Various additional helpers for Load/StoreInst
* `changeFunctionType`
2021-12-17 18:48:36 +01:00
Alessandro Di Federico 6bec368276 PromoteStackPointer: import test 2021-12-17 14:01:43 +01:00
Alessandro Di Federico 6fcf1673c9 Adopt eraseFromParent 2021-12-17 14:01:28 +01:00
Alessandro Di Federico f38cc9ea06 Drop AdjustStackPointer 2021-12-17 14:01:22 +01:00
Alessandro Di Federico 12ef260876 Adopt new pipeline in tests 2021-12-17 14:01:17 +01:00