Mercurial > lcfOS
diff python/ir/basicblock.py @ 205:d77cb5962cc5
Added some handcoded arm code generation
author | Windel Bouwman |
---|---|
date | Sun, 23 Jun 2013 18:23:18 +0200 |
parents | 460db5669efa |
children | 1fa3e0050b49 |
line wrap: on
line diff
--- a/python/ir/basicblock.py Fri Jun 21 15:01:08 2013 +0200 +++ b/python/ir/basicblock.py Sun Jun 23 18:23:18 2013 +0200 @@ -10,17 +10,21 @@ i.parent = self self.instructions.append(i) addIns = addInstruction + def replaceInstruction(self, i1, i2): idx = self.instructions.index(i1) i1.parent = None i1.delete() i2.parent = self self.instructions[idx] = i2 + def removeInstruction(self, i): i.parent = None self.instructions.remove(i) + def getInstructions(self): - return self.instructions + return self.instructions + def setInstructions(self, ins): for i in self.instructions: i.parent = None @@ -28,6 +32,7 @@ for i in self.instructions: i.parent = self Instructions = property(getInstructions, setInstructions) + def getLastIns(self): return self.instructions[-1] LastInstruction = property(getLastIns)