diff python/ppci/irmach.py @ 323:e9fe6988497c

Used burg for generating expressions
author Windel Bouwman
date Thu, 30 Jan 2014 19:03:24 +0100
parents 6753763d3bec
children 86b02c98a717
line wrap: on
line diff
--- a/python/ppci/irmach.py	Mon Jan 27 19:58:07 2014 +0100
+++ b/python/ppci/irmach.py	Thu Jan 30 19:03:24 2014 +0100
@@ -11,7 +11,7 @@
 
 
 class Frame:
-    """ 
+    """
         Activation record abstraction. This class contains a flattened 
         function. Instructions are selected and scheduled at this stage.
         Frames differ per machine.
@@ -54,16 +54,12 @@
         """
             Substitutes source, dst and labels in the string
         """
-        x = str(self.assem)
-        for i, s in enumerate(self.src):
-            p = '%s{}'.format(i)
-            x = x.replace(p, str(s))
-        for i, d in enumerate(self.dst):
-            p = '%d{}'.format(i)
-            x = x.replace(p, str(d))
-        for i, j in enumerate(self.jumps):
-            p = '%l{}'.format(i)
-            x = x.replace(p, str(j))
+        if isinstance(self.assem, Instruction):
+            x = str(self.assem)
+        else:
+            cn = self.assem.__name__
+            x = '{}, def={}, use={}, other={}'
+            x = x.format(cn, self.dst, self.src, self.others)
         return x