Commit Graph

6113 Commits

Author SHA1 Message Date
Djordje Todorovic 5559d8431b Introduce fix-model model pass 2022-09-21 18:37:36 +02:00
Giacomo Vercesi 7c900d45ca revng.daemon: fix for ariadne>=0.16 2022-09-21 14:07:24 +02:00
Alvise de Faveri 999df25246 Add revng model export type-graph tool
This tools dumps a type, a function or an entire type-system to a
dot file,representing dependencies between types as edges.
2022-09-19 08:35:06 +02:00
Pietro Fezzardi ec9a5b0608 Use lexicographical compare for model::Qualifier 2022-09-19 08:34:20 +02:00
Pietro Fezzardi 12ab345848 SubGraph: make getEntryNode more const-correct
GraphTraits<SubGraph<InnerNodeType>>::getEntryNode now takes a const
GraphType &, not just a GraphType &.
2022-09-19 08:33:45 +02:00
Davide Depau 286a9fe2d3 revng-analyze: add InitRevng to entrypoint 2022-09-19 08:32:02 +02:00
Davide Depau 42e932ad39 revng-artifact: add InitRevng to entrypoint 2022-09-19 08:31:55 +02:00
Pietro Fezzardi e594454745 Merge feature/dla-arrange-accesses-hierarchically 2022-09-15 11:48:27 +02:00
Pietro Fezzardi e47733eb66 DLA: new Middleend pipeline 2022-09-15 11:47:11 +02:00
Pietro Fezzardi f0a1903201 DLA: add ArrangeAccessesHierarchically dla::Step 2022-09-15 11:47:11 +02:00
Pietro Fezzardi 8ff8a795e4 DLA: Add DecomposeStridedEdges dla::Step 2022-09-14 11:33:37 +02:00
Pietro Fezzardi 47c06350ca FieldSizeComputation: add #include <cstdint> 2022-09-12 17:52:53 +02:00
Pietro Fezzardi 695c1529db dla::LayoutTypeSystem add eraseEdge method 2022-09-12 17:52:50 +02:00
Pietro Fezzardi 38e4658762 Add LayoutTypeSystem::NeighborIterator type 2022-09-12 12:28:48 +02:00
Pietro Fezzardi f83e513eb7 DLA: fix bug in DeduplicateFields
A logic bug caused the wrong detection of nodes with many fields.
As a result, the field deduplication was only executed on a subset of
the real candidates.
This caused the following two problems.
- Degradation of the quality of the results, i.e. unions that could be
  deduplicated were not deduplicated.
- Failing assertions in rare cases.
  The algorithm assumes that if it's looking at the children
  (C1, ..., Cn) of node A to be deduplicated, then all (C1, ..., Cn)
  have beed already visited, hence they don't have children that should
  be duplicated because they would have been deduplicated already, when
  looking at (C1, ..., Cn). The bug possibly caused to miss the
  deduplication of children of Ci (for some i) causing assertions to
  fail when looking at A to deduplicate (C1, ..., Cn).
2022-09-12 12:14:52 +02:00
Pietro Fezzardi 3ec19a4a93 Add dla::OffsetExpression::append() static method 2022-09-12 12:14:52 +02:00
Pietro Fezzardi fb652dedb8 Add dla::OffsetExpression::verify() 2022-09-12 12:14:52 +02:00
Pietro Fezzardi f5ef671ecc Enforce revng check-conventions 2022-09-12 12:14:52 +02:00
Alessandro Di Federico 137fad57e9 revng-daemon tests: increase verbosity 2022-09-08 09:44:41 +02:00
Alessandro Di Federico fa3ed38f97 Merge branch 'feature/rework-schema-generator' 2022-09-02 16:34:45 +02:00
Giacomo Vercesi 67e970e1e8 Fix revng cli invocation with namespaces
When revng cli was invoked with a bare namespace, e.g. `revng ptml`
it would produce an ugly exception.
Fix this behavior by instead rerunning the command with `--help`
appended.
2022-09-02 03:49:56 +02:00
Giacomo Vercesi c084620ef2 Switch from yarn to npm 2022-09-02 03:49:56 +02:00
Giacomo Vercesi ae5522e861 tuple_tree_generator: minor TypeScript fixes 2022-09-02 03:49:54 +02:00
Alessandro Di Federico ee6d80fa17 Merge branch 'feature/emit-ptml-in-c-backend' 2022-09-01 17:48:25 +02:00
Giacomo Vercesi d68640e2cb upcast: use universal references 2022-09-01 17:48:00 +02:00
Giacomo Vercesi a7eb0a8d59 Ranks.h: introduce additional Ranks 2022-09-01 17:47:55 +02:00
Giacomo Vercesi 37caa91e6d Ranks: fix Rank keys
Use model::Function::Key for the Function rank instead of the naked
MetaAddress as it allows forward-compatibility if the model::Function
key is ever changed.

Use a std::tuple<uint64_t> for TypeField as it's the current type for
{Struct,Enum,Union}Field.key()
2022-09-01 17:46:57 +02:00
Giacomo Vercesi 7cff7737ac Introduce ModelHelpers.h
ModelHelpers contains helper functions that produce the appropiate
edit path for the given elements of the model.
2022-09-01 17:46:40 +02:00
Giacomo Vercesi e443cd3766 YAMLTraits.h: add traits for std::tuple<T>
This commit introduces a YAML trait for `std:tuple`s of a single
scalar that allows their serialization/deserialization generically.
2022-09-01 17:46:35 +02:00
Giacomo Vercesi 8aab66a517 Rank.h: restrict keys to scalars and enums
Rank keys so far could be of any type as long as it was
yaml-serializable, however this would introduce problems down the
line if a Location contained for example array or mapping.
This commit restricts the type of keys to only scalars and enums,
to limit the chance that a key serializes in an invalid location.
2022-09-01 17:46:30 +02:00
Giacomo Vercesi 7d77d388b5 ConstexprString: allow default construction 2022-09-01 17:46:30 +02:00
Giacomo Vercesi a05737696f Introduce revng/Model/ForwardDecls.h 2022-09-01 17:46:25 +02:00
Giacomo Vercesi b7a23dcd4a Rename and improve ptml::TagScope
Renames ptml::TagScope to ScopeTag and fixes issue when Tag.scope
was called with a temporary.
2022-09-01 17:46:10 +02:00
Giacomo Vercesi e1adce0f69 PTMLIndentedOstream: rework write_impl
Previous implementation would write '\n' if the buffer ended with
'\n\n'.
2022-09-01 17:46:04 +02:00
Giacomo Vercesi 07c2457a16 revng.cli: various improvements
This commit introduces some miscellaneous fixes to revng.cli:

* Remove useless subclasses in pipeline_tools.py;
* Improve type annotations in _commands/ptml and fix a help string;
* Add some extra type annotations for `Command`;
* Remove useless namespaces in `commands_registry` and add help text
  for the ones in use;
2022-09-01 17:45:44 +02:00
Giacomo Vercesi 8e996d2394 Output PTML in revng-c
Change the output of the backend of revng-c to PTML
2022-09-01 16:59:29 +02:00
Giacomo Vercesi bbbcbd080a revng ptml cat: add C highlighting 2022-09-01 15:49:44 +02:00
Giacomo Vercesi 84e29d6b96 Fix linkage of Tag::scope in Tag.h 2022-09-01 15:49:44 +02:00
Alessandro Di Federico 74d912c01f Segregate: fix failure if nothing needs to be done
In case no model::Function needs to be acted upon, an assertion was
failing.
2022-09-01 15:10:02 +02:00
Alessandro Di Federico b0bfa5db4a CollectCFG: nop if root is absent 2022-09-01 14:58:50 +02:00
Pietro Fezzardi eb16f4141a MakeModelGEP: remove too strict assertion 2022-09-01 14:31:19 +02:00
Alessandro Di Federico 40f1e06135 CFGAnalyzer, opaque_true: use inaccessiblememonly
This prevents EarlyCSE from deduplicating calls to this functions with
the same arguments, which has unintend effects and leads to loss of
code.
2022-09-01 11:32:42 +02:00
Alessandro Di Federico df34095721 Minor changes 2022-09-01 11:32:12 +02:00
Ivan Krysak 4c08f2153d install_pattern: do not use git ls-files 2022-08-31 19:42:35 +02:00
Alessandro Di Federico ed2672d12f Merge branch 'feature/pipeline-analysis-args' 2022-08-31 18:08:00 +02:00
Massimo Fioravanti 9a4e97d8ea Pipeline: handle having 0 functions 2022-08-31 18:07:47 +02:00
Alessandro Di Federico 712585be48 CodeGenerator: handle PTC translation failure 2022-08-31 18:07:47 +02:00
Alessandro Di Federico d8230c3e9a revng-pipeline: improve error reporting 2022-08-31 18:07:47 +02:00
Alessandro Di Federico b14b40b1eb revng: do not print failing command 2022-08-31 18:07:47 +02:00
Alessandro Di Federico f93eefda66 replaceAll: move to STLExtras.h 2022-08-31 18:07:47 +02:00