Commit Graph

9 Commits

Author SHA1 Message Date
Alastair Robertson
98008f9054 TypeGraph: Add IdentifyContainers mutator pass 2023-11-06 11:28:00 +00:00
Alastair Robertson
ff31971bd3 Printer: Use NodeIds for stable IDs when printing graphs
This removes Printer's legacy behaviour of generating an ID for each
node as it gets printed. This old method meant that if new nodes were
added to or removed from a graph, every ID after the new/removed node
would change.

Now IDs are stable so it is easier to follow specific nodes through
multiple transformation passes in CodeGen.
2023-08-16 12:19:14 +01:00
Jake Hillion
d7cfcca30d move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
Alastair Robertson
30cd23fa53 TypeGraph: Introduce TypeGraphParser to simplify unit testing
TypeGraphParser parses a textual type graph, as emitted by Printer.

It also doubles as a way of ensuring that Printer displays all
information about a type graph, to aid with debugging.

Convert Flattener unit tests over to this new framework as a first step.
2023-07-13 17:38:49 +01:00
Alastair Robertson
11ca1b0b00 Flattener: Fix seg-fault in the case of specific bad DWARF
Also add negative tests for fixAllocatorParams(), covering this case and
more.
2023-07-11 13:52:15 +01:00
Alastair Robertson
23efc8d2d6 TypeGraph: Add Node IDs to non-leaf types
These aren't used for anything yet, but should be useful for stable IDs
when printing nodes before and after passes and for faster cycle
detection than the current map of pointers.
2023-07-06 14:54:30 +01:00
Alastair Robertson
c9bcf5e760 TopoSorter: Fix sorting of container template parameters
For std::vector and std::list, template parameters are not required to
be defined before they can be used. Delay sorting them until the end.

Also fix a CodeGen bug where we were defining typedefs in the middle of
the forward declarations. They only need to be defined when other types
are defined.
2023-07-05 13:10:28 +01:00
Alastair Robertson
02b764157d Tests: Add a CodeGen test 2023-06-23 14:23:53 +01:00
Alastair Robertson
e1bc5c7b5e Tests: Split common code out into type_graph_utils 2023-05-31 15:49:37 +01:00