comparison python/ir/instruction.py @ 209:07bfea4c1ed7

Added codegen test
author Windel Bouwman
date Sat, 29 Jun 2013 10:08:46 +0200
parents d77cb5962cc5
children 1fa3e0050b49
comparison
equal deleted inserted replaced
208:4cb47d80fd1f 209:07bfea4c1ed7
34 self.live_out = set() 34 self.live_out = set()
35 # What variables this instruction uses and defines: 35 # What variables this instruction uses and defines:
36 self.defs = [] 36 self.defs = []
37 self.uses = [] 37 self.uses = []
38 def delete(self): 38 def delete(self):
39 for use in self.uses: 39 while self.uses:
40 use.delete() 40 use = self.uses.pop()
41 self.uses.clear() 41 use.delete()
42 def addUse(self, val): 42 def addUse(self, val):
43 self.uses.append(Use(self, val)) 43 self.uses.append(Use(self, val))
44 def addDef(self, v): 44 def addDef(self, v):
45 self.defs.append(v) 45 self.defs.append(v)
46 def getParent(self): 46 def getParent(self):