diff python/ppci/codegen/codegen.py @ 364:c49459768aaa

Work on globals
author Windel Bouwman
date Wed, 19 Mar 2014 20:24:03 +0100
parents c2ddc8a36f5e
children 39bf68bf1891
line wrap: on
line diff
--- a/python/ppci/codegen/codegen.py	Sun Mar 16 11:28:47 2014 +0100
+++ b/python/ppci/codegen/codegen.py	Wed Mar 19 20:24:03 2014 +0100
@@ -51,6 +51,10 @@
     def generate(self, ircode, outs):
         """ Generate code into output stream """
         assert isinstance(ircode, ir.Module)
+        outs.select_section('data')
+        for global_variable in ircode.Variables:
+            print(global_variable)
+            self.target.emit_global(outs, ir.label_name(global_variable))
         outs.select_section('code')
 
         # Munch program into a bunch of frames. One frame per function.