view python/ir/function.py @ 202:f22b431f4113

Added arm add instruction
author Windel Bouwman
date Sat, 15 Jun 2013 10:02:50 +0200
parents 460db5669efa
children d77cb5962cc5
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)
      bb.parent = self
   def removeBasicBlock(self, bb):
      self.bbs.remove(bb)
      bb.parent = None
   def getBBs(self):
      return self.bbs
   BasicBlocks = property(getBBs)