Commit Graph

100 Commits

Author SHA1 Message Date
Antonio Frighetto 7c671ed6de TupleTreeDiff: evict cached references in apply
As the input model requires to be mutable, `evictCachedReferences`
is needed in order to invalidate cached references.
2023-02-06 09:37:23 +01:00
Antonio Frighetto ea0a06a876 revng.daemon: accept no arguments for analysis
Let GraphQL accept zero or more parameters for analyses.
2023-02-06 09:37:23 +01:00
Massimo Fioravanti dad043027d Rework and EFA yield cross relations
Yield and EFA shared the same namespace, this commits splits them and
introduces tuple tree containers as well.
2023-02-06 09:37:23 +01:00
Massimo Fioravanti 4d2f1f71b4 Remove static asserts in tuple tree references
`TupleTreeReference`s use the Root type as a pointer only so they can
operate with forward declarations. Before this commit there were static
asserts that prevented this use case, and thus required the headers
defining the root type to be included before this one to work correctly.

We drop those `static_assert`s to make sure that all headers are parsable
on their own.
2022-12-09 14:01:10 +01:00
Alessandro Di Federico a96270a8aa TupleTree::visit: externalize 2022-12-09 10:11:27 +01:00
Alessandro Di Federico 22c1ec78eb TupleTree: handle type-erased visitors
This commit reduces build times by introducing a type-erasure layer when
performing a visit on TupleTrees. Basically instead of propagating the
type of the visitor along all of the template castle, we wrap the
visitor into a virtual class with one method for each possible type in
the TupleTree.
This enables a single instatiation of visit algorithm.
2022-12-09 09:10:39 +01:00
Alessandro Di Federico 693b361e4a TupleTree: externalize several methods 2022-12-09 09:08:40 +01:00
Alessandro Di Federico c3fc2d1f88 TupleTreeDiff deserialization: fix initialization
We used to assign an uninitialized field to `false`. However, what we
really wanted to is to construct the optional by invoking the default
constructor of the `value_type` of the optional.
2022-12-09 09:02:35 +01:00
Alessandro Di Federico c75a3450c1 TupleTree::deserialize: drop useless yaml::Input
This was a leftover from yaml::Input usages centralization.
2022-12-09 08:58:30 +01:00
Pietro Fezzardi 4334481894 UpcastablePointer: upcast with mutable callables 2022-11-15 14:15:20 +01:00
Giacomo Vercesi 0b80801b2b TupleTreeDiff: applyDiff uses ErrorList
Change how TupleTreeDiff and Visitor work so they can populate an
ErrorList in case the deserialization/apply of a diff fails.
2022-10-30 09:13:44 +01:00
Pietro Fezzardi d04e2e73d3 TupleTree: caching methods for TupleTreeReferences 2022-10-29 16:46:19 +02:00
Pietro Fezzardi 0795c7e331 TupleTreeReference: cache target pointers 2022-10-29 16:46:19 +02:00
Pietro Fezzardi cf3103d3d7 TupleTree{Path,Reference}: add operator<=> 2022-10-29 16:46:19 +02:00
Pietro Fezzardi 8e9170eb60 Enforce that TTRs in TupleTree are mutable 2022-10-29 16:46:19 +02:00
Pietro Fezzardi 6173d154a3 TupleTree: visitReferences with non-const visitors 2022-10-29 16:46:19 +02:00
Pietro Fezzardi 5f8dab184d Move ConstOrNot to Concepts.h 2022-10-29 16:46:19 +02:00
Ivan Krysak 6638055ecf TupleTreeCompatible: drop NotTupleTreeCompatible 2022-09-26 12:01:56 +02:00
Massimo Fioravanti 261a114d6d Pipeline: corner-case fix in backward deduction 2022-08-10 09:49:24 +02:00
Ivan Krysak 65d1a016d4 Standardize concept naming across the codebase 2022-08-05 17:27:56 +03:00
Giacomo Vercesi 09009836a1 PipelineC: expose globals verification 2022-07-28 08:47:46 +02:00
Massimo Fioravanti f0a5ffe3b3 revng-pipeline: globals, extractOne and analyses 2022-05-24 08:58:48 +02:00
Massimo Fioravanti 2c48713af9 Make TupleTreeDiff compatible with regular vectors 2022-05-24 08:50:24 +02:00
Pietro Fezzardi 741d55279b TupleTree: add copy-constructor and -assignment
The copy of a TupleTree is potentially very expensive, so it was
disabled until now and only allowed via the explict method clone().

We have now decided to make TupleTree copiable.
This commit adds a copy-constructor and a copy-assignment, killing the
clone() method that was already unused and is now effectively useless.
2022-05-11 16:16:49 +02:00
Massimo Fioravanti 016a9464b8 Model diff: handle UpcastablePointer correctly 2022-04-29 17:57:49 +02:00
Massimo Fioravanti df2413962b Introduce TupleTreePath::isPrefixOf(Other) 2022-04-15 15:16:02 +02:00
Massimo Fioravanti 44720eedbd Redesign TupleTreeDiff
`TupleTreeDiff` is now type-safe and owns the changes.
2022-04-15 15:14:13 +02:00
Massimo Fioravanti 38a3c5a086 Introduce TupleTree::deserialize 2022-04-15 15:14:02 +02:00
Antonio Frighetto 5848063b66 TupleTree: make const TupleTree& behave as such
A logic issue was addressed with improved state management.
2022-04-05 15:37:57 +02:00
Pietro Fezzardi b4c733ab57 Move Concepts.h into include/ADT for better reuse 2022-03-30 17:09:24 +02:00
Ivan Krysak 326624f517 Fix TupleTreeCompatible linkage problem
Now all the generated `.cpp` include `Binary.h`. This ensures we don't
trigger the wrong concept due to forward declarations.

Also, this commit introduces a couple of `static_assert`s which should
enable us to early identification of similar problems.
2022-03-28 15:33:30 +02:00
Massimo Fioravanti 39e0f0ac96 TupleTreeDiff<Binary>: fix compile errors 2022-03-28 12:17:05 +02:00
Alessandro Di Federico 10dc6744b4 mv include/revng/{Model,TupleTree}/EnumTraits.h
`EnumTraits.h` is not model-specific.
2022-02-23 17:32:50 +01:00
Ivan Krysak c14567e3d0 Make TupleTree::visitReferences public 2022-02-14 11:28:36 +01:00
Ivan Krysak fd3e7243c1 Remove an unused parameter from TupleTree::clone 2022-02-14 11:28:36 +01:00
Ivan Krysak 7151c587f9 Prevent TupleTreeReference::isValid() asserts 2022-02-14 10:56:50 +01:00
Alessandro Di Federico 78be0e9268 Explode TupleTree.h 2022-01-31 16:28:26 +01:00
Alessandro Di Federico 29cf330fc8 TupleTreeDiff: use streams 2022-01-31 14:13:25 +01:00
Alessandro Di Federico 5c89a6a858 callOnPathSteps: fix UpcastablePointer handling
The version of callOnPathSteps without an actual instance was completely
ignoring the upcasted type of `UpcastablePointer`s. We now fix this by
calling the right template specialization, which we choose by inspecting
the key of the `UpcastablePointer`.
2022-01-31 14:13:25 +01:00
Alessandro Di Federico c1ec001f46 TupleTreeDiff: dump any object 2022-01-31 14:13:25 +01:00
Alessandro Di Federico 09054e637a Introduce TupleTree::replaceReferences 2022-01-27 11:51:03 +01:00
Alessandro Di Federico 97db1d5f50 Make TypePaths comparable 2022-01-27 11:51:03 +01:00
Alessandro Di Federico 5484896e3f TupleTreeDiff: fix path construction
This commit fixes a bug that led to put in a `TupleTreePath` an object
instead of its key.
2022-01-27 11:51:03 +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
Alessandro Di Federico cfb47157b9 clang-tidy: readability-identifier-naming
This commit fixes all the non-compliance with our preliminary clang-tidy
configuration, which will be merged soon.
2022-01-07 09:18:05 +01:00
Alessandro Di Federico d78993ac54 Add TupleTree file (de)serialization
Tuple tree file serialization will be used by the revng-pipeline as a
helper function to load and store the models in the working directory.
2022-01-05 14:44:57 +01:00
Pietro Fezzardi e37425c686 TupleTreeReference: add getConst() method 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 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
Alessandro Di Federico 4d7a175996 Extract TupleTree 2021-12-22 17:47:54 +01:00