# HG changeset patch # User Windel Bouwman # Date 1387394540 -3600 # Node ID 38f5f298ce0e22973cbb4c6e8ac18070426b82e9 # Parent 04cf4d26a3bc59cd239657ca1e9a7231e5d14cb0 Add log for interference graph diff -r 04cf4d26a3bc -r 38f5f298ce0e doc/compiler.rst --- a/doc/compiler.rst Wed Dec 18 18:02:26 2013 +0100 +++ b/doc/compiler.rst Wed Dec 18 20:22:20 2013 +0100 @@ -1,5 +1,9 @@ +.. toctree:: + + ir + Compiler ======== diff -r 04cf4d26a3bc -r 38f5f298ce0e python/ppci/codegen/interferencegraph.py --- a/python/ppci/codegen/interferencegraph.py Wed Dec 18 18:02:26 2013 +0100 +++ b/python/ppci/codegen/interferencegraph.py Wed Dec 18 20:22:20 2013 +0100 @@ -55,9 +55,9 @@ def to_dot(self, f): """ Generate graphviz dot representation """ for n in self.nodes: - print('{} [label="{}" shape=box3d];'.format(id(n), n), file=f) + print(' {} [label="{}" shape=box3d];'.format(id(n), n), file=f) for n, m in self.edges: - print('{} -> {};'.format(id(n), id(m)), file=f) + print(' {} -> {};'.format(id(n), id(m)), file=f) def to_txt(self): for node in self.nodes: diff -r 04cf4d26a3bc -r 38f5f298ce0e python/zcc.py --- a/python/zcc.py Wed Dec 18 18:02:26 2013 +0100 +++ b/python/zcc.py Wed Dec 18 20:22:20 2013 +0100 @@ -33,6 +33,7 @@ def format(self, record): s = super().format(record) + s += '\n' if hasattr(record, 'c3_ast'): f = io.StringIO() print('', file=f) @@ -84,6 +85,18 @@ print(' }', file=f) print('', file=f) s += '\n' + f.getvalue() + if hasattr(record, 'ra_ig'): + f = io.StringIO() + print('', file=f) + print('', file=f) + print('.. graphviz::', file=f) + print('', file=f) + print(' digraph G {', file=f) + ig = record.ra_ig + ig.to_dot(f) + print(' }', file=f) + print('', file=f) + s += '\n' + f.getvalue() return s