Mercurial > lcfOS
diff python/ir/instruction.py @ 204:de3a68f677a5
Added long comment to c3 parser
author | Windel Bouwman |
---|---|
date | Fri, 21 Jun 2013 15:01:08 +0200 |
parents | 460db5669efa |
children | d77cb5962cc5 |
line wrap: on
line diff
--- a/python/ir/instruction.py Sat Jun 15 19:13:05 2013 +0200 +++ b/python/ir/instruction.py Fri Jun 21 15:01:08 2013 +0200 @@ -16,6 +16,7 @@ class Use: def __init__(self, user, val): self.user = user + assert type(val) is Value self.val = val self.val.used_by.append(self.user) def delete(self): @@ -99,6 +100,7 @@ class ImmLoad(Instruction): def __init__(self, target, value): super().__init__() + assert type(target) is Value self.target = target self.value = value self.addDef(target) @@ -111,6 +113,8 @@ super().__init__() #print('operation is in binops:', operation in BinOps) # Check types of the two operands: + assert type(value1) is Value + assert type(value2) is Value self.result = result self.addDef(result) self.value1 = value1