view python/ir/function.py @ 173:c1d2b6b9f9a7

Rework into passes
author Windel Bouwman
date Fri, 19 Apr 2013 12:42:21 +0200
parents 5a7d37d615ee
children 460db5669efa
line wrap: on
line source

from .basicblock import BasicBlock

class Function:
   def __init__(self, name):
      self.name = name
      self.bbs = []
      self.entry = None
   def __repr__(self):
      return 'Function {0}'.format(self.name)
   def addBB(self, bb):
      self.bbs.append(bb)
   def getBBs(self):
      return self.bbs
   BasicBlocks = property(getBBs)