Mercurial > lcfOS
annotate python/ir/function.py @ 199:a690473b79e2
Added msp430 target
author | Windel Bouwman |
---|---|
date | Fri, 07 Jun 2013 18:59:57 +0200 |
parents | 460db5669efa |
children | d77cb5962cc5 |
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) | |
177 | 12 bb.parent = self |
13 def removeBasicBlock(self, bb): | |
14 self.bbs.remove(bb) | |
15 bb.parent = None | |
172 | 16 def getBBs(self): |
17 return self.bbs | |
18 BasicBlocks = property(getBBs) | |
19 | |
20 |