Mercurial > lcfOS
diff python/zcc.py @ 314:38f5f298ce0e
Add log for interference graph
author | Windel Bouwman |
---|---|
date | Wed, 18 Dec 2013 20:22:20 +0100 |
parents | 04cf4d26a3bc |
children | 084cccaa5deb |
line wrap: on
line diff
--- 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