This commit drops libptc in favor of its new form libtcg.
It brings several improvements, among which:
* The QEMU version we work on has been upgraded.
* CPUStateAccessAnalysis has been reimplemented in a way that makes it
easier to debug and solves some limitations (e.g., tracking leaking
pointers).
* Identification of pieces of the CPU state that are read by each helper
and fixing access to the CPU state is now performed at build-time.
* We no longer mmap the code we need to translate, dropping all the
issues related to code that needed to be mapped where something is
already present.
* We now have two distinct flavors of helper modules: the full one and
the "slim" one. The latter contains the definition only of functions
we intend to inline. It is used in most of the pipeline, a good thing
since we spend less time optimizing code we don't really care about.
The full module is only used on the re-compilation branch of the
pipeline.
* We no longer split the `cpu_loop` function.
* We change MetaAddress to rely on architectures from `model::` as
opposed to the LLVM ones.
* We no longer attach debug info to LLVM IR containing the original
assembly.
* We now verify that the lifted code only contains code we expect.
This also unifies `get_default_value` helper across all the target
languages.
Before this, there were two different versions of it for python
and typescript while c++ side didn't have one at all.
Note that other code-generating TTG-backends (namely python and
typescript) emitting ones already support this. This is just a matter
of extending similar logic to the c++ backend.
After this commit, every non-key field is treated as if it was optional
while every key field (plus every auto-generated `Kind` field) - as if
it was required.
This allows to avoid having to specify the `rootType` (stable within
the entire tree) manually each time a reference is introduced.
Thanks to that, a much nicer syntax of:
```yaml
- name: MyTypeField
reference-to: TypeDefinition
```
can replace the current one:
```yaml
- name: MyTypeField
reference:
pointeeType: TypeDefinition
rootType: Binary
```
Debugging is a lot harder when you cannot just diff outputs of
the generator.
This commit ensures types are always emitted in the same order,
no matter the input schema ordering or the target language.
Add a class implementing the descriptor protocol to allow TypedList
fields to be assigned a `list` and automatically convert it to the
TypedList class.
The `namespace` property is strictly used just by the cpp generator.
Move the code so the `--namespace` option is exclusive to it and removed
for all the other generators.
Merge all the command-line scripts for generating tuple-tree
implementations into a single `tuple-tree-generate.py` script. Move all
the other files a directory down.
Add a python interface (`revng.profile`) for interacting with the rev.ng
infrastructure as a whole; either through the CLI (`CLIProject`) or the
GraphQL API (`DaemonProject`).
Here we start restructuring the the schemas YAML such that it
contains a top-level `version` field. In this commit we only modify
the YAML, the build system changes will come later, to avoid
enormous commits.
In this commit we instruct the build system to use the unified schema
files instead of collecting the `TUPLE-TREE-YAML` comments.
The fixes to C++ files are necessary because they depend on the order
of the fields in the schema, which was changed.
The `prettier` binary is now assumed to be installed as part of the
system. No need to manually install it and use the `--prettier`
command-line option.