Mercurial > lcfOS
annotate 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 |
rev | line source |
---|---|
172 | 1 from .basicblock import BasicBlock |
2 | |
3 class Function: | |
4 def __init__(self, name): | |
5 self.name = name | |
6 self.bbs = [] | |
7 self.entry = None | |
8 def __repr__(self): | |
173 | 9 return 'Function {0}'.format(self.name) |
172 | 10 def addBB(self, bb): |
11 self.bbs.append(bb) | |
12 def getBBs(self): | |
13 return self.bbs | |
14 BasicBlocks = property(getBBs) | |
15 | |
16 |