Mercurial > lcfOS
comparison python/zcc.py @ 311:ff665880a6b0
Added testcase for kernel and userspace
author | Windel Bouwman |
---|---|
date | Mon, 16 Dec 2013 12:49:24 +0100 |
parents | b145f8e6050b |
children | 2c9768114877 |
comparison
equal
deleted
inserted
replaced
310:e95e5572cd6d | 311:ff665880a6b0 |
---|---|
8 import ppci | 8 import ppci |
9 from ppci.codegen import CodeGenerator | 9 from ppci.codegen import CodeGenerator |
10 import outstream | 10 import outstream |
11 from utils import HexFile | 11 from utils import HexFile |
12 import target | 12 import target |
13 from ppci import irutils | |
14 import io | |
13 | 15 |
14 | 16 |
15 logformat='%(asctime)s|%(levelname)s|%(name)s|%(message)s' | 17 logformat='%(asctime)s|%(levelname)s|%(name)s|%(message)s' |
16 | 18 |
17 | 19 |
65 if not ircode: | 67 if not ircode: |
66 return | 68 return |
67 # Optimization passes, TODO | 69 # Optimization passes, TODO |
68 | 70 |
69 if dumpir: | 71 if dumpir: |
70 ircode.dump() | 72 f = io.StringIO() |
73 irutils.Writer().write(ircode, f) | |
74 print(f.getvalue()) | |
71 | 75 |
72 # Code generation: | 76 # Code generation: |
73 logging.info('Starting code generation for {}'.format(ircode)) | 77 logging.info('Starting code generation for {}'.format(ircode)) |
74 cg.generate(ircode, outs) | 78 cg.generate(ircode, outs) |
75 # TODO: fixup references, do this in another way? | 79 # TODO: fixup references, do this in another way? |