Mercurial > lcfOS
changeset 265:9e235f15372b
Test
author | Windel Bouwman |
---|---|
date | Fri, 09 Aug 2013 16:37:19 +0200 |
parents | f8b5da5784b8 |
children | 649884d9dc61 |
files | python/ir/instruction.py |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/python/ir/instruction.py Fri Aug 09 16:30:26 2013 +0200 +++ b/python/ir/instruction.py Fri Aug 09 16:37:19 2013 +0200 @@ -285,7 +285,7 @@ class ConditionalBranch(Terminator): - def __init__(self, a, cond, b, lab1, lab2): + def __init__(self, a, cond, b, lab1, lab2): super().__init__() self.a = a assert type(a) is Value @@ -300,12 +300,13 @@ assert type(lab2) is BasicBlock self.lab2 = lab2 - def __repr__(self): - return 'IF {0} {1} {2} THEN {3} ELSE {4}'.format(self.a, self.cond, self.b, self.lab1, self.lab2) - def getTargets(self): - return [self.lab1, self.lab2] + def __repr__(self): + return 'IF {0} {1} {2} THEN {3} ELSE {4}'.format(self.a, self.cond, self.b, self.lab1, self.lab2) - def changeTarget(self, tfrom, tto): + def getTargets(self): + return [self.lab1, self.lab2] + + def changeTarget(self, tfrom, tto): assert tfrom is self.lab1 or tfrom is self.lab2 if tfrom is self.lab1: self.lab1 = tto