comparison python/c3/codegenerator.py @ 227:82dfe6a32717

Fixed tests
author Windel Bouwman
date Fri, 12 Jul 2013 17:42:39 +0200
parents 1c7364bd74c7
children 7f18ed9b6b7e
comparison
equal deleted inserted replaced
226:240111e0456f 227:82dfe6a32717
164 addr = self.genExprCode(expr.ptr) 164 addr = self.genExprCode(expr.ptr)
165 tmp = self.builder.newTmp('deref') 165 tmp = self.builder.newTmp('deref')
166 ins = ir.Load(addr, tmp) 166 ins = ir.Load(addr, tmp)
167 self.builder.addIns(ins) 167 self.builder.addIns(ins)
168 return tmp 168 return tmp
169 elif type(expr) is astnodes.FieldRef:
170 tmp = self.builder.newTmp('struct_mem' + expr.field)
171 #ins = ir.BinaryOperator(
172 # TODO: add offset?
173 return tmp
169 elif type(expr) is astnodes.Literal: 174 elif type(expr) is astnodes.Literal:
170 tmp = self.builder.newTmp() 175 tmp = self.builder.newTmp()
171 ins = ir.ImmLoad(tmp, expr.val) 176 ins = ir.ImmLoad(tmp, expr.val)
172 self.builder.addIns(ins) 177 self.builder.addIns(ins)
173 return tmp 178 return tmp