Mercurial > lcfOS
comparison python/ir/module.py @ 177:460db5669efa
Added clean pass for IR
author | Windel Bouwman |
---|---|
date | Mon, 22 Apr 2013 23:54:54 +0200 |
parents | 3eb06f5fb987 |
children | d77cb5962cc5 |
comparison
equal
deleted
inserted
replaced
176:5fd02aa38b42 | 177:460db5669efa |
---|---|
43 contents = str(bb) + '\n' | 43 contents = str(bb) + '\n' |
44 contents += '\n'.join([str(i) for i in bb.Instructions]) | 44 contents += '\n'.join([str(i) for i in bb.Instructions]) |
45 outf.write('{0} [shape=note label="{1}"];\n'.format(id(bb), contents)) | 45 outf.write('{0} [shape=note label="{1}"];\n'.format(id(bb), contents)) |
46 for successor in bb.Successors: | 46 for successor in bb.Successors: |
47 outf.write('"{0}" -> "{1}"\n'.format(id(bb), id(successor))) | 47 outf.write('"{0}" -> "{1}"\n'.format(id(bb), id(successor))) |
48 # Draw dags if any: | |
49 if hasattr(bb, 'dag'): | |
50 outf.write('{0} -> {1}\n'.format(id(bb), id(bb.dag))) | |
51 bb.dag.dumpgv(outf) | |
52 | |
48 outf.write('"{0}" -> "{1}" [label="entry"]\n'.format(id(f), id(f.entry))) | 53 outf.write('"{0}" -> "{1}" [label="entry"]\n'.format(id(f), id(f.entry))) |
49 outf.write('}\n') | 54 outf.write('}\n') |
50 | 55 |
51 # Analysis functions: | 56 # Analysis functions: |
52 def check(self): | 57 def check(self): |