comparison python/ir/function.py @ 147:4e79484a9d47

Moved core to ir folder
author Windel Bouwman
date Fri, 22 Feb 2013 10:33:48 +0100
parents python/ppci/core/function.py@9e552d34bd60
children
comparison
equal deleted inserted replaced
146:91af0e40f868 147:4e79484a9d47
1
2 class Argument:
3 def __init__(self, argtype, name, function):
4 self.t = argtype
5 self.name = name
6 self.function = function
7
8 class Function(GlobalValue):
9 def __init__(self, functiontype, name, module):
10 super().__init__()
11 self.functiontype = functiontype
12 self.name = name
13 self.module = module
14
15 self.module.Functions.append(self)
16 self.basicblocks = []
17 self.arguments = []
18 # Construct formal arguments depending on function type
19
20 BasicBlocks = property(lambda self: self.basicblocks)
21 Arguments = property(lambda self: self.arguments)
22 ReturnType = property(lambda self: self.functiontype.returnType)
23 FunctionType = property(lambda self: self.functiontype)
24