diff python/c3/codegenerator.py @ 205:d77cb5962cc5

Added some handcoded arm code generation
author Windel Bouwman
date Sun, 23 Jun 2013 18:23:18 +0200
parents de3a68f677a5
children 8b2e5f3cd579
line wrap: on
line diff
--- a/python/c3/codegenerator.py	Fri Jun 21 15:01:08 2013 +0200
+++ b/python/c3/codegenerator.py	Sun Jun 23 18:23:18 2013 +0200
@@ -23,7 +23,7 @@
             self.funcMap[s] = f
       for s in pkg.scope:
          if type(s) is astnodes.Variable:
-              v = self.builder.newTmp(s.name)
+              v = self.builder.newVariable(s.name)
               #self.builder.addIns(ir.Alloc(v))
               self.varMap[s] = v
          elif type(s) is astnodes.Function:
@@ -116,9 +116,9 @@
             raise NotImlementedError('Unknown condition {0}'.format(expr))
       elif type(expr) is astnodes.Literal:
          if expr.val:
-            self.builder.addIns(ir.BranchInstruction(bbtrue))
+            self.builder.addIns(ir.Branch(bbtrue))
          else:
-            self.builder.addIns(ir.BranchInstruction(bbfalse))
+            self.builder.addIns(ir.Branch(bbfalse))
       else:
          print('Unknown cond', expr)
    def genExprCode(self, expr):