diff python/testir.py @ 173:c1d2b6b9f9a7

Rework into passes
author Windel Bouwman
date Fri, 19 Apr 2013 12:42:21 +0200
parents 5a7d37d615ee
children 3eb06f5fb987
line wrap: on
line diff
--- a/python/testir.py	Thu Apr 04 17:58:37 2013 +0200
+++ b/python/testir.py	Fri Apr 19 12:42:21 2013 +0200
@@ -1,4 +1,4 @@
-import c3, ppci, ir, x86
+import c3, ppci, ir, x86, transform
 import os
 
 testsrc = """
@@ -39,9 +39,13 @@
    cgenx86 = x86.X86CodeGen(diag)
    ir = builder.build(testsrc)
    diag.printErrors(testsrc)
+   #ir.dump()
+   cf = transform.ConstantFolder()
+   dcd = transform.DeadCodeDeleter()
    ir.check()
-   ir.analyze()
-   #ir.constantProp()
+   cf.run(ir)
+   cf.run(ir)
+   #dcd.run(ir)
    ir.dump()
    asm = cgenx86.genBin(ir)
    for a in asm: