comparison python/flowgraph.py @ 274:ea93e0a7a31e

Move docs
author Windel Bouwman
date Wed, 04 Sep 2013 17:35:06 +0200
parents 5f8c04a8d26b
children 046017431c6a
comparison
equal deleted inserted replaced
273:6b3a874edd6e 274:ea93e0a7a31e
11 self.defs = set(ins.dst) 11 self.defs = set(ins.dst)
12 self.live_in = set() 12 self.live_in = set()
13 self.live_out = set() 13 self.live_out = set()
14 14
15 def __repr__(self): 15 def __repr__(self):
16 return '{}, use={}, def={}'.format(self.ins, self.uses, self.defs) 16 r = '{}'.format(self.ins)
17 if self.uses:
18 r += ' uses:' + ', '.join(str(u) for u in self.uses)
19 if self.defs:
20 r += ' defs:' + ', '.join(str(d) for d in self.defs)
21 return r
17 22
18 23
19 class FlowGraph(graph.Graph): 24 class FlowGraph(graph.Graph):
20 def __init__(self, instrs): 25 def __init__(self, instrs):
21 """ Create a flowgraph from a list of abstract instructions """ 26 """ Create a flowgraph from a list of abstract instructions """