diff python/c3/codegenerator.py @ 255:7416c923a02a

Added more logging
author Windel Bouwman
date Sun, 04 Aug 2013 15:10:10 +0200
parents c4370696ccc7
children ac603eb66b63
line wrap: on
line diff
--- a/python/c3/codegenerator.py	Wed Jul 31 21:20:58 2013 +0200
+++ b/python/c3/codegenerator.py	Sun Aug 04 15:10:10 2013 +0200
@@ -1,3 +1,4 @@
+import logging
 import ir
 from . import astnodes
 from .scope import boolType, intType
@@ -8,9 +9,12 @@
     '&':'and', '>>':'shl', '<<':'shr'}
 
 class CodeGenerator:
+    def __init__(self):
+        self.logger = logging.getLogger('c3')
     """ Generates intermediate code from a package """
     def gencode(self, pkg):
         assert type(pkg) is astnodes.Package
+        self.logger.info('Generating ir-code for {}'.format(pkg.name))
         self.varMap = {} # Maps variables to storage locations.
         self.funcMap = {}
         self.builder = ir.Builder()