26 Commits

Author SHA1 Message Date
Pietro Fezzardi 8cec15cebc TypeSystemPrinter: fix port number without return
Before this commit the port number was incorrectly increased when there
were no arguments in a function type, causing edges to be routed in a
less accurate way.
This commit fixes the problem.
2025-11-28 16:05:58 +01:00
Pietro Fezzardi 0f99de99ff TypeSystemPrinter: order in and out edges
To make the whole graph more deterministic and more readable.
2025-11-28 16:05:58 +01:00
Pietro Fezzardi 83da56ea7a TypeSystemPrinter: set top level IDs
This uses the "rank=source" feature of graphviz, that allows to select
what are the nodes with mimimal rank in a graph.

We use this to mark all the nodes that represent functions and segments
so that the graph layout is more deterministic and readable across
multiple runs when the input Model is very similar.
2025-11-28 16:05:57 +01:00
Pietro Fezzardi 67245347a8 TypeSystemPrinter: refactor node name computation 2025-11-28 16:05:57 +01:00
Pietro Fezzardi 2f6c8b6f67 TypeSystemPrinter: fix CABIFT with empty return 2025-05-29 09:31:26 +02:00
Pietro Fezzardi 7741e00e29 TypeSystemPrinter: fix CABIFT with empty return 2025-05-13 16:18:34 +02:00
Ivan Krysak 25790b5a78 NameBuilder: change automatic segment name
Use index within the binary instead of address in order to make these
shorter.
2025-04-15 16:35:42 +03:00
Ivan Krysak 645cf7fc2e NameBuilder: sunset deduplication
This reworks NameBuilder to ease the transition to the system where
the model will be guaranteed to never contain any name collisions, both
between user-specified names and the automatic ones.
2025-04-15 16:35:42 +03:00
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak 2be6f4aebb TypeSystemPrinter: adopt name builder 2024-11-06 15:43:13 +02:00
Ivan Krysak e52dd97937 TypeSystemPrinter: improve formatting
- change the font of the emitted graph to `Courier`, which is the only
  monospace font graphviz guarantees to support
- tweak color of the union definitions to be slightly lighter (so that
  it doesn't clash as much with the other colors used)
- change the color of all the "other" nodes (like typedef) from white
  to grey, so that they are visible on light backgrounds.
- leave a todo about `buildFieldName` being obsolete.
2024-06-27 11:05:52 +02:00
Ivan Krysak 4a2db0ba4f UpcastablePointer: streamline empty behavior 2024-06-27 11:05:52 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak ac587cbb4f Model: rename Type into TypeDefinition 2024-06-27 11:05:48 +02:00
Pietro Fezzardi bbcb4df839 TypeSystemPrinter: print segment types 2023-12-05 16:19:39 +01:00
Pietro Fezzardi 1285c6e7af Make RawFunctionType::StackArgumentsType a TTR
This is homogeneous with all other nullable references to types in the
model, such as the StackFrameType in model::Function, and others.
2023-12-05 16:19:38 +01:00
Pietro Fezzardi 43d6a2c5c5 TypeSystemPrinter: allow prototype-less functions
Before this commit, the TypeSystemPrinter implicitly assumed that
model::Function and model::DynamicFunction always had a prototype.

However, this is not guaranteed by the model schema.

This commit extends the TypeSystemPrinter so that it doesn't make that
wrong assumption anymore, and can successfully print any model::Function
and model::DynamicFunction, even when a prototype is not present.
2023-10-31 17:42:13 +01:00
Alessandro Di Federico f51af94e8f TupleTreeReference::isValid is for assertions only 2023-08-23 16:14:05 +02:00
Pietro Fezzardi 72bedb7dfd TypeSystemPrinter: print DynamicFunctions 2023-08-21 12:29:31 +02:00
Pietro Fezzardi 659a461b02 TypeSystemPrinter: fix handling of 0-sized types 2023-08-21 12:11:34 +02:00
Ivan Krysak bc98e0079f Formatting: change PenaltyReturnTypeOnItsOwnLine
The new value is 21.
2023-07-02 13:20:49 +02:00
Giacomo Vercesi 31cd2b53f9 rcc: add codespell
Add codespell to the list of checks performed by
revng-check-conventions. This should reduce the amount of typos present
in the revng codebase.
2023-05-11 10:05:32 +02:00
Pietro Fezzardi 04d877a992 TypeSystemPrint: fix print without stack type 2023-02-02 14:49:46 +01:00
Massimo Fioravanti 742e1a0c56 TupleTree: switch from public fields to accessors 2022-12-12 18:36:57 +01:00
Pietro Fezzardi 43cb77e6a3 TypeSystemPrinter: route edge to the top of nodes 2022-10-06 17:53:47 +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