Mercurial > lcfOS
diff python/c3/codegenerator.py @ 231:521567d17388
simplify blink.c3
author | Windel Bouwman |
---|---|
date | Sat, 13 Jul 2013 20:20:44 +0200 |
parents | 88a1e0baef65 |
children | e621e3ba78d2 |
line wrap: on
line diff
--- a/python/c3/codegenerator.py Sat Jul 13 19:53:44 2013 +0200 +++ b/python/c3/codegenerator.py Sat Jul 13 20:20:44 2013 +0200 @@ -2,7 +2,7 @@ from . import astnodes from .scope import boolType, intType from ppci import CompilerError -from .typecheck import resolveType +from .typecheck import theType tmpnames = {'+':'add', '-':'sub', '*': 'mul', '/':'div', '|':'or', '&':'and'} @@ -179,7 +179,7 @@ elif type(expr) is astnodes.FieldRef: b = self.genExprCode(expr.base) offset = self.builder.newTmp('off_' + expr.field) - bt = resolveType(expr.base.typ) + bt = theType(expr.base.typ) ofs = bt.fieldOffset(expr.field) ins = ir.ImmLoad(offset, ofs) self.builder.addIns(ins) @@ -194,7 +194,7 @@ return tmp elif type(expr) is astnodes.TypeCast: ar = self.genExprCode(expr.a) - tt = resolveType(expr.to_type) + tt = theType(expr.to_type) if isinstance(tt, astnodes.PointerType): if expr.a.typ is intType: return ar