Commit Graph

1642 Commits

Author SHA1 Message Date
Alessandro Di Federico 280848484e SerializeModelPass: verify model 2022-01-31 16:28:17 +01:00
Alessandro Di Federico c0f8110e4e s/revng-compare-yaml/revng-model-compare/ 2022-01-31 16:28:17 +01:00
Alessandro Di Federico 0d7decccb3 s/revng-dump-model/revng-model-to-json/ 2022-01-31 16:28:17 +01:00
Alessandro Di Federico 7fba073058 Enable testing model diff 2022-01-31 16:28:17 +01:00
Alessandro Di Federico a353e00ac1 Introduce model passes 2022-01-31 16:28:14 +01:00
Alessandro Di Federico 3980ee3fad Introduce model tools 2022-01-31 16:28:14 +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 2c2832c027 Merge branch 'feature/dedup-model-types' 2022-01-27 13:46:17 +01:00
Alessandro Di Federico b3d6c721ad Introduce purgeUnnamedAndUnreachableTypes 2022-01-27 11:51:03 +01:00
Alessandro Di Federico f14e722c86 Introduce deduplicateEquivalentTypes 2022-01-27 11:51:03 +01:00
Alessandro Di Federico f3634e165f Introduce model::Type::localCompare 2022-01-27 11:51:03 +01:00
Alessandro Di Federico d0bb3d4c2c CodeGenerator.cpp: use OriginalName for symbols 2022-01-27 11:51:03 +01:00
Alessandro Di Federico 445066bd0a CodeGenerator.cpp: posticipate DWARF import
This way we apply the optimization passes.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 2d08050220 DwarfImporter: adopt OriginalName 2022-01-27 11:51:03 +01:00
Alessandro Di Federico dd7477664c Update CustomName verification criteria
This commit ensures `CustomName` is unambiguous according to C symbols
rules.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 74a7496020 deduplicateNames -> promoteOriginalName
This commit switches from `deduplicateNames`, which changed certain
`CustomName` values, to `promoteOriginalName`, which updates empty
`CustomName` using non-ambiguous versions of `OriginalName`.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 3d1df0ab7d Use OriginalName in tests/analysis/*.yml 2022-01-27 11:51:03 +01:00
Alessandro Di Federico 863652f480 Introduce OriginalName in the type system
The goal of `OriginalName` is to keep track of the original name of a
symbol upon import.

In future, this will also be used to promote it to `CustomName`.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 8d22c5205f Push CustomName to model::Type
Before this commit `CustomName` was in each inheritor, except for
`model::PrimitiveType`.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 54fcc1d7fe struct_impl.cpp.tpl: include headers in any case 2022-01-27 11:51:03 +01:00
Alessandro Di Federico 680924b643 CodeGenerator.cpp: drop some outdated assertions
Drop some outdated checks for `model::Binary::ImportedDynamicFunctions`
being sorted.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 48565ee905 Move skip to STLExtras.h
It has nothing to do with IR.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 09054e637a Introduce TupleTree::replaceReferences 2022-01-27 11:51:03 +01:00
Alessandro Di Federico b31e7b1f5e Introduce model::Type::edges()
This makes building a graph for the type system very easy.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 56536ba231 STLExtras.h: introduce IsTupleLike concept
One day we'll need to make it report error messages in a more effective
way.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 80ed065206 model::Type: move makeTypeWithID to .cpp
It needs to see the full declaration of all concrete types.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 4f29a70df8 UpcastablePointer.h: pointee: skip over const 2022-01-27 11:51:03 +01:00
Alessandro Di Federico 7441497171 Function.h should not include Binary.h
`Function.h` should see a forward declaration of `model::Binary` and
`Binary.h` should include `Function.h`.
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 92ea78b0a8 Fix ReservedKeywords list
Commas were missing.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico c9d47d4ee7 Drop model::EnumEntry::Aliases
They turn out to be problematic to handle in the model and not very
usable in practice.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 0a0b546bdc Speed up Python dependency checks
Checking Python dependencies has significantly slown down CMake
configuration phase.

We were using `pip show` for each dependency, we now do everything in a
single invocation `pip list`.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 1ce1f1cbd6 model::Function::verify: relax assumptions
Now `model::Function` can miss the CFG, the `Prototype` and have
`Invalid` type.
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
Alessandro Di Federico 1d839ba156 IRHelpers.h: drop erase_if
We have `llvm::erase_if`.
2022-01-27 11:51:03 +01:00
Alessandro Di Federico 7ea55326e1 tuple_tree_generator: use all_optional_fields 2022-01-27 11:50:37 +01:00
Alessandro Di Federico 3799f1e973 Whitespace and other minor changes 2022-01-25 21:27:05 +01:00
Alessandro Di Federico b0eed9fe10 Merge branch 'feature/more-robust-tuple-tree-generator' 2022-01-21 18:12:24 +01:00
Alessandro Di Federico 679851afb0 TupleTreeGenerator.cmake: depend on scripts 2022-01-21 18:07:24 +01:00
Filippo Cremonese 31354a4cd6 metaschema.yml: actually enforce validation
Previously, we didn't specify the type of the root object, which led to
accept any input.
2022-01-21 18:05:52 +01:00
Filippo Cremonese f10bc1a410 Check pyparsing version at configure time
Otherwise, people will get obscure error messages.
2022-01-21 18:05:51 +01:00
Alessandro Di Federico 3ab32cd2ef tuple_tree_generator: make fully standalone 2022-01-21 18:05:51 +01:00
Filippo Cremonese c7a0d05379 tuple_tree_generator: remove unused include 2022-01-21 18:05:49 +01:00
Filippo Cremonese 610d5112c7 tuple_tree_generator: fix type lookup 2022-01-21 18:03:07 +01:00
Alessandro Di Federico 71c279a837 Merge branch 'feature/revng-pipeline' 2022-01-17 18:18:13 +01:00
Massimo Fioravanti 70ec456078 Introduce revng-pipeline 2022-01-17 18:17:54 +01:00
Massimo Fioravanti b4f9162078 Introduce helper function to emit indentation 2022-01-17 18:17:54 +01:00
Massimo Fioravanti afbebaf531 ProgramRunner: fix misuse of executable path
ProgramRunner was using garbage data instead of correctly using the path
to the current executable directory.
2022-01-17 18:17:54 +01:00