diff python/ir/instruction.py @ 205:d77cb5962cc5

Added some handcoded arm code generation
author Windel Bouwman
date Sun, 23 Jun 2013 18:23:18 +0200
parents de3a68f677a5
children 07bfea4c1ed7
line wrap: on
line diff
--- a/python/ir/instruction.py	Fri Jun 21 15:01:08 2013 +0200
+++ b/python/ir/instruction.py	Sun Jun 23 18:23:18 2013 +0200
@@ -1,6 +1,7 @@
 from .basicblock import BasicBlock
 from .function import Function
 
+
 class Value:
    """ Temporary SSA value (value that is assigned only once! """
    def __init__(self, name):
@@ -13,10 +14,13 @@
    def IsUsed(self):
       return len(self.used_by) > 0
 
+class Variable(Value):
+    pass
+
 class Use:
    def __init__(self, user, val):
       self.user = user
-      assert type(val) is Value
+      assert isinstance(val, Value)
       self.val = val
       self.val.used_by.append(self.user)
    def delete(self):
@@ -130,7 +134,7 @@
    def __init__(self, location, value):
       super().__init__()
       assert type(value) is Value
-      assert type(location) is Value, "Location must be a value"
+      assert isinstance(location, Value), "Location must be a value"
       self.value = value
       self.addDef(value)
       self.location = location
@@ -142,7 +146,7 @@
    def __init__(self, location, value):
       super().__init__()
       assert type(value) is Value
-      assert type(location) is Value, "Location must be a value"
+      assert isinstance(location, Value), "Location must be a value"
       self.location = location
       self.value = value
       self.addUse(value)