From 153b17db0807c990026f29f27cecdbf79a8f60d2 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 5 Dec 2022 23:21:49 -0800 Subject: [PATCH] add pack=true attribute to graphviz graph --- .../_tests/test_register_allocator.py | 1 + src/bigint_presentation_code/register_allocator.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bigint_presentation_code/_tests/test_register_allocator.py b/src/bigint_presentation_code/_tests/test_register_allocator.py index 7db0796..9cf6270 100644 --- a/src/bigint_presentation_code/_tests/test_register_allocator.py +++ b/src/bigint_presentation_code/_tests/test_register_allocator.py @@ -264,6 +264,7 @@ class TestRegisterAllocator(unittest.TestCase): self.assertEqual(graphs, { 'initial': 'graph {\n' + ' graph [pack = true]\n' ' "0" [label = ">: 0"]\n' ' "1" [label = ">: 0"]\n' ' "2" [label = ">: 0"]\n' diff --git a/src/bigint_presentation_code/register_allocator.py b/src/bigint_presentation_code/register_allocator.py index 6e7d87c..94de331 100644 --- a/src/bigint_presentation_code/register_allocator.py +++ b/src/bigint_presentation_code/register_allocator.py @@ -474,7 +474,10 @@ class InterferenceGraph: # both directions if edge_key not in edges and edge_key[::-1] not in edges: edges[edge_key] = edge - lines = ["graph {"] + lines = [ + "graph {", + " graph [pack = true]", + ] for node, node_id in node_ids.items(): label_lines = [] # type: list[str] for k, v in node.merged_ssa_val.ssa_val_offsets.items(): -- 2.30.2