Mercurial > lcfOS
diff python/ppci/c3/codegenerator.py @ 362:c05ab629976a
Added CPUID for arm
author | Windel Bouwman |
---|---|
date | Sat, 15 Mar 2014 10:56:34 +0100 |
parents | 42343d189e14 |
children | 396e5cefba13 |
line wrap: on
line diff
--- a/python/ppci/c3/codegenerator.py Fri Mar 14 16:18:54 2014 +0100 +++ b/python/ppci/c3/codegenerator.py Sat Mar 15 10:56:34 2014 +0100 @@ -40,12 +40,15 @@ self.funcMap = {} self.m = ir.Module(pkg.name) try: - for s in pkg.innerScope.Functions: + # Only generate function if function contains a body: + real_functions = list(filter(lambda f: f.body, pkg.innerScope.Functions)) + #real_functions = list(filter(None, pkg.innerScope.Functions)) + for s in real_functions: f = self.newFunction(s.name) self.funcMap[s] = f for v in pkg.innerScope.Variables: self.varMap[v] = self.newTemp() - for s in pkg.innerScope.Functions: + for s in real_functions: self.gen_function(s) except SemanticError as e: self.error(e.msg, e.loc)