Commit Graph

249 Commits

Author SHA1 Message Date
Alessandro Di Federico 620d142d53 Reroganize and expand documentation 2024-12-11 16:15:37 +01:00
Alessandro Di Federico 0c7c20ad48 Introduce model, artifacts and analyses references 2024-12-11 16:15:27 +01:00
Alessandro Di Federico 276a4aa974 Generate model docs 2024-12-11 16:15:10 +01:00
Ivan Krysak 8a774b22f5 Model: forbid copies and moves of abstract structs 2024-11-06 15:43:13 +02:00
Alessandro Di Federico c1cbb4e9a0 Initialize pointers to nullptr 2024-09-27 12:07:17 +02:00
Ivan Krysak 4a2db0ba4f UpcastablePointer: streamline empty behavior 2024-06-27 11:05:52 +02:00
Ivan Krysak 823e561806 TTG: rework polymorphic serialization
For now, the only serialization trait we were verifying
a polymorphic TTG type to have was the wrong (the one
that only printed base class's fields).

This commit explicitly disables said serializer and
ensures it's never used.

Here's an illustration of the impact of the changes:
```
model::UpcastableType MyType = getTypeFromSomewhere();
model::Type &View = *MyType;
model::PointerType &Pointer = MyType->asPointer();

serialize(MyType); // Good
serialize(Pointer); // Good
serialize(View); // new: explicit error
                 // old: only print base type's fields
```
2024-06-27 11:05:51 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak a4f638082d TTG: stop treating GUID as optional 2024-06-27 11:05:50 +02:00
Ivan Krysak a51d755608 TTG: add a static assert on a get miss 2024-06-27 11:05:50 +02:00
Ivan Krysak 806e90a124 TTG: change typescript generator to use comments 2024-06-27 11:05:50 +02:00
Ivan Krysak 9e6bf29f74 TTG: pull dump helper into the template 2024-06-27 11:05:49 +02:00
Ivan Krysak 35444268b3 TTG: strip Kind from the child constructor 2024-06-27 11:05:49 +02:00
Ivan Krysak edb2d11c9a TTG: add upcastable struct field support 2024-06-27 11:05:49 +02:00
Ivan Krysak ee238fd473 RCC: allow prettier to print errors 2024-06-27 11:05:49 +02:00
Ivan Krysak 32fd1eed5b TTG: move classof boilerplate into the template 2024-06-27 11:05:49 +02:00
Ivan Krysak 48ace7c147 TTG: reorder early struct template
This heavily improves readability of the generated header.
2024-06-27 11:05:49 +02:00
Ivan Krysak a85ce02b29 TTG: clean impl.cpp formatting up 2024-06-27 11:05:49 +02:00
Ivan Krysak 37f424da06 TTG: move UpcastableX typedef to the template 2024-06-27 11:05:49 +02:00
Ivan Krysak ce1f13e715 TTG: fix parseClass argument type 2024-06-27 11:05:48 +02:00
Ivan Krysak 93b5ad6067 TTG: add indirect dependencies to root's late.h 2024-06-27 11:05:48 +02:00
Ivan Krysak c109d50814 TTG: remove self passthrough 2024-06-27 11:05:48 +02:00
Ivan Krysak 0438a207fc TTG: improve early struct header formatting 2024-06-27 11:05:48 +02:00
Ivan Krysak b2959e36df Minor improvements 2024-06-27 11:05:48 +02:00
Alessandro Di Federico b5f7576573 Rework TupleTreeGenerator tracking 2024-06-20 10:24:50 +02:00
Alessandro Di Federico 3ea5efdc93 Various minor Python improvements 2024-06-20 10:24:49 +02:00
Giacomo Vercesi db6c5d9b7c Model: avoid warning regarding unescaped \
In some of the descriptions of Model fields/methods there are specicial
doxygen commands, such as `\sa`. These show up in python in docstrings
unescaped, causing warnings such as `SyntaxWarning: invalid escape
sequence '\s'`. In order to avoid these, replace the `\` with `\\` which
escapes to a `\`.
2024-06-06 15:45:02 +02:00
Alessandro Di Federico bf6cefc05a Externalize functions to improve build times 2024-05-03 21:52:40 +02:00
Alessandro Di Federico fe1dffcffd Add some missing includes
This is in preparation of reducing headers in Debug.h.
2024-05-03 21:52:40 +02:00
Alessandro Di Federico 0459b9d084 Introduce RegisterUsageAnalyses 2024-04-19 18:33:00 +02:00
Ivan Krysak b25a32de2a Stop using std:: prefix for std::size_t 2024-01-29 11:57:54 +02:00
Massimo Fioravanti f6ff8e544d Add tracking debug infrastructure
Add a mechanism to make the program crash when a given element of the
model is read or written.
2024-01-02 11:14:56 +01:00
Massimo Fioravanti c276a439b5 Add pipeline invalidation
Replace the stub implementation of invalidation with the proper
implementation. A ReadPathCache is added to each global so that it can
keep tracks of what target are associated to which read paths.
2024-01-02 11:14:56 +01:00
Giacomo Vercesi bc7cde4cf7 tuple_tree.ts: fix diffing for abstract types
The previous `makeDiff` implementation did account nor have enough
information to be able to upcast abstract types. This commit introduces
the necessary information for this to happen.
2023-11-03 16:30:40 +01:00
Giacomo Vercesi 29b229455f Tuple Tree: rename Parent in struct.h.tpl
Rename the Parent attribute of a struct to BaseClass to avoid conflicts
with Tuple Tree structs that might need that attribute.
2023-09-14 15:44:32 +02:00
Giacomo Vercesi 786d01925a tuple_tree_gen.ts.tpl: fix Global name alias
Fix the case in the typescript tuple tree generator where the global
name coincides with the name of the root object.
2023-09-14 15:44:32 +02:00
Giacomo Vercesi 90ea42b695 model/_util.py: move into tupletree.py
Move the contents of `model/_util.py` into `tupletree.py` as it's
model-agnostic and used by all generated Python tuple-tree wrappers.
2023-09-14 15:44:32 +02:00
Giacomo Vercesi d2967d2a49 Tuple Tree Generator: remove Model headers
This commit removes the inclusion of the `Binary.h` header in
Tuple-Tree Generator files, allowing Model-independent Tuple Trees to be
generated.
2023-09-14 15:44:32 +02:00
Giacomo Vercesi 2a99f50040 revng-model.ts: allow individual serdes
Allow the serialization and deserialization of individual model objects,
this is useful when these need to be exchanged individually across an
IPC boundary.
2023-07-31 16:05:52 +02:00
Ivan Krysak 7893d53ef8 TTG: add Parent using definition 2023-07-21 17:25:24 +02:00
Ivan Krysak b4061793f3 TTG: fix accessor comment and constness
Also improve whitespace adjacent formatting
2023-07-21 17:25:24 +02:00
Giacomo Vercesi 27c065a54b model.ts: implement makeDiff speedups
Make `makeDiff` run faster by:
* Utilizing the information exposed by TYPE_HINTS which avoids having
  expensive runtime checks
* Optimize some of the hot parts of the codebase to lower run times
2023-07-21 13:19:04 +02:00
Giacomo Vercesi 3a006422d3 typescript/python model wrappers: fix structure
Change the way the python and typescript model wrappers handle
attributes in struct fields. Now all fields are populated and none of
the use `None`.
2023-07-21 09:34:00 +02:00
Massimo Fioravanti 69aafd4181 TupleTree: implement tracking data manipulation
Implement the core visits that are able to inspect the model bypassing
the instrumentation.
2023-04-21 17:51:05 +02:00
Massimo Fioravanti 254dc99fcb TupleTreeGenerator: emit tracking machinery 2023-04-21 17:50:16 +02:00
Giacomo Vercesi a2b7d0e0bf PipelineC: add tracing
Add support for tracing onto the PipelineC. This is done by:
1. Creating wrapper functions for each PipelineC function with the
   script in `scripts/PipelineC_add_tracing.py`. These will call a
   special function called `wrap` which will ultimately call a method
   with a `_` prepended to the name
2. Conversion of all PipelineC methods in `PipelineC.cpp` to `static`
   and their rename with a `_` in front, in order for them to work with
   the wrapper function in (1)
3. Generation of 2 additional include files, one for types and one for
   functions, to be used by users of tracing files in order to have
   introspection.

These steps allow the creation of a trace file with the use of the
`REVNG_C_API_TRACE_PATH` environment variable. The traces can then be
used in conjunction with the `revng trace run` and `revng trace
inspect` commands.
2023-04-20 14:43:13 +02:00
Ivan Krysak 1248f8532d TTG: enable vectors of enumerations 2023-03-15 10:19:01 +01:00
Ivan Krysak 11c0d7f02e Stop using \brief doxygen command 2023-03-15 10:19:01 +01:00
Giacomo Vercesi 31bb77237f typescript: add setElementByPath function
add the setElementByPath function which allows setting a value in a
tuple tree give a tuple tree path to apply it to
Also apply some small fixes to the `tuple_tree.ts` codebase
2023-02-07 16:54:35 +01:00
Massimo Fioravanti 742e1a0c56 TupleTree: switch from public fields to accessors 2022-12-12 18:36:57 +01:00