Commit Graph

6113 Commits

Author SHA1 Message Date
Khaled Ismaeel 8b355fc896 Add primitive support for generating migrations 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 9b07b3bcce Add primitive migration support to the CLI 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 7156cace7b Drop multiversion support in Python model wrapper 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 030becfeba Adapt the build to the new schema version field
This is a followup to the commit where we introduced the `version`
field in the schema YAML.
2025-04-30 15:08:45 +02:00
Khaled Ismaeel 383af5b6b0 Add the version field to schemas YAML
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.
2025-04-30 15:08:45 +02:00
Khaled Ismaeel 531d9b866c Remove the now-redundant HEADERS list 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 53a5ff07cf Remove embedded TUPLE-TREE-YAML 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 63469c9cd6 Use unified YAML schemas in the build process
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.
2025-04-30 15:08:45 +02:00
Khaled Ismaeel f384b10435 Check schemas into the codebase
These schema files are currently generated at build time by
collecting various TUPLE-TREE-YAML comments using the
`extract_yaml.py` script. In this commit we move them to the codebase
but we don't use them yet, this will be done at a later commit for
the sake of readability.
2025-04-30 15:08:40 +02:00
Giacomo Vercesi 9ff471409e Remove some asserts from YAMLTraits
More soft-fails instead.
2025-04-28 12:58:27 +02:00
Khaled Ismaeel b656ea073a Fix erroneous include 2025-04-28 12:58:27 +02:00
Alessandro Di Federico bf7be3460c Add missing dependency on generated file
This addresses a bug where running `ninja -j1` fails.
2025-04-28 12:58:27 +02:00
Alessandro Di Federico bf4838dcb2 Merge branch 'feature/automatic-dynamic-function-names' 2025-04-24 13:22:20 +02:00
Ivan Krysak 1622bb91a1 Introduce automatic names for dynamic functions 2025-04-24 13:22:14 +02:00
Ivan Krysak 1bce76f511 Bring name mangling out into a support helper 2025-04-24 13:22:14 +02:00
Giacomo Vercesi 6509cad084 test_docs: remove useless global
The `verbose` was is not modified in the `log` function, so the use of
`global` is useless.
2025-04-24 13:22:14 +02:00
Giacomo Vercesi e7fdd22966 extract-helper-names.sh: fix unquoted variable 2025-04-24 13:22:14 +02:00
Giacomo Vercesi 0ac78dddba Fix codespell errors
Fix erros detected by the new version of `codespell`.
2025-04-24 13:22:14 +02:00
Pietro Fezzardi 3fb05869c5 Merge branch 'feature/prevent-geps-evs' 2025-04-22 17:48:27 +02:00
Pietro Fezzardi 5ca182578b Add InstCombineNoArraysPass
This pass wraps LLVM's vanilla InstCombine, to hijack one of its
options. The goal of this hijack is to prevent InstCombine from
splitting and replacing accesses to arrays with GEPs and smaller
accesses.
2025-04-22 17:23:37 +02:00
Pietro Fezzardi ef2c3a7626 Add SROANoArraysPass
This pass wraps LLVM's vanilla SROA, to hijack one of its options.
The goal of this hijack is to prevent SROA from splitting and replacing
memory accesses to arrays with GEPs and smaller accesses.
2025-04-22 17:19:56 +02:00
Pietro Fezzardi 3b10a3c5d9 Move SimplifyCFGWithHoistAndSinkPass to new file
This will be used to collect various customizations of LLVM passes, that
are necessary to enable setting different default options to passes for
insertion in the revng pipeline.
2025-04-22 17:18:26 +02:00
Pietro Fezzardi 0cb3abc9c3 LocalVariableBuilder: make array-typed allocas
This reduces the occasions where some LLVM optimization passes rewrite
the allocas, reducing the chances that the model type metadata is
discarded by LLVM passes that we don't control.
A pass that was doing this was InstCombine.
2025-04-22 15:24:30 +02:00
Pietro Fezzardi 33197fb937 LocalVariables: fix VariableTypeMDName string
Before this commit it was set to "revng.stack_type" for a silly
copy-paste error.
2025-04-22 15:24:30 +02:00
Alessandro Di Federico eb794e499e Merge branch 'feature/no-more-original-names' 2025-04-17 17:29:19 +02:00
Ivan Krysak 79964eac74 Avoid ' misuse in error messages and comments 2025-04-17 16:41:21 +02:00
Ivan Krysak 83324fcf07 NameBuilder: improve documentation 2025-04-17 11:19:17 +03:00
Ivan Krysak c8de226f56 DwarfImporter: remove an input-dependent assert
Not checking for primitives there doesn't change anything anyway, as
`purge-invalid-types` model pass will clean anything invalid still
left after the importer.
2025-04-17 11:19:17 +03:00
Ivan Krysak ae3f19664a ModelPasses: introduce fix-model 2025-04-17 11:19:17 +03:00
Ivan Krysak 76ed261375 Use revng_undefined_ instead of init_
Current `init_` prefix used to set the default values of SCVs
is very common in typical code, hence it would cause a lot of
collisions.
2025-04-17 11:19:17 +03:00
Ivan Krysak 0c99d5d5fb IDBImporter: omit unnecessary typedefs 2025-04-17 11:19:17 +03:00
Ivan Krysak 2eed7f2410 IDBImporter: fix an incorrect type check 2025-04-17 11:19:17 +03:00
Ivan Krysak c6e38cd485 Return to using constant name builders
Because of how name builders used to lazy gather namespaces on the first
requested name, the objects were self mutating. As such only non-const
references could be used to pass them around.

Since that is no longer the case, this restores most of lost const
qualifiers.
2025-04-17 11:19:17 +03:00
Ivan Krysak 61f2c122b1 Canonicalize: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 18829dc7e4 RestructureCFG: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 8a8e0ce4ae PromoteStackPointer: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 2c8e0d68c8 FunctionCallIdentification: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 274e0f298a EFA: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 5d0986c315 FunctionIsolation: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak e1c8c370f7 Lift: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 0af6eaf494 BasicAnalyses: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 514e6c56e0 ProgramCounterHandler: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 48a7822923 FunctionTags: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 24b96e4480 IRHelpers: introduce a const callers helper 2025-04-17 11:19:17 +03:00
Ivan Krysak 7b02ab0e44 getJTReasons: Work on const instructions 2025-04-17 11:19:17 +03:00
Ivan Krysak 76a2bffc94 Introduce an IR helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 6a6b34b831 Introduce a general static registry helper 2025-04-17 11:19:17 +03:00
Ivan Krysak dc7d08555e Decompile: verify helper names are consistent 2025-04-17 11:19:17 +03:00
Ivan Krysak b72bcd7dd2 Introduce a basic problem name reporting system 2025-04-17 11:19:17 +03:00
Ivan Krysak aa15d8ca21 Standardize abort-like function usage 2025-04-17 11:19:17 +03:00