diff python/ir/function.py @ 172:5a7d37d615ee

Added function to IR
author Windel Bouwman
date Thu, 04 Apr 2013 17:58:37 +0200
parents
children c1d2b6b9f9a7
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/ir/function.py	Thu Apr 04 17:58:37 2013 +0200
@@ -0,0 +1,16 @@
+from .basicblock import BasicBlock
+
+class Function:
+   def __init__(self, name):
+      self.name = name
+      self.bbs = []
+      self.entry = None
+   def __repr__(self):
+      return 'FUNC {0}, entry:{1}'.format(self.name, self.entry)
+   def addBB(self, bb):
+      self.bbs.append(bb)
+   def getBBs(self):
+      return self.bbs
+   BasicBlocks = property(getBBs)
+
+