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.
Non-composite keys are single-element tuples, therefore they don't
directly inherit the YAML serialization of their only element.
This commit enables building `ScalarTraits` for keys in all cases.
Add a specialized list class to be used in the model. This will do
runtime instance checking to make sure that list-like fields in the
model only contain object of the correct type.
Fix the constructor for required sequence fields, now they use a
`default_factory` with `list` to construct an empty list when none is
passed to the constructor.
Implement a constructor override for model classes that checks that the
constructor does not have positional arguments passed to it. This can
be dropped post-3.10 since it is implemented natively by kw_only.
Before this commit, clang-format somw clang format errors were
discarded.
This commit fixes the problems, in two ways:
- passes -Werror to clang-format, to make it stricter when reporting
errors
- drops a wrong || true when `--force-format` is passed resulting in bad
error codes
Improves the generation of the file list by using git diff-files and
parsing the output directly.
Also:
* The list now only includes files that exist in the working directory
(so no existence checks are needed).
* Added `--cached` option to check staged files only.
* Fix some missing local variable declarations.
* Only check dirty files by default (--all checks all files).
* Better file identification
* Various bash improvements
* Report more explicative errors
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.
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".