105
|
1
|
|
2 class Argument:
|
|
3 def __init__(self, argtype, name, function):
|
|
4 self.t = argtype
|
|
5 self.name = name
|
|
6 self.function = function
|
70
|
7
|
|
8 class Function:
|
104
|
9 def __init__(self, functiontype, name, module):
|
|
10 self.functiontype = functiontype
|
|
11 self.name = name
|
|
12 self.module = module
|
106
|
13
|
|
14 self.module.Functions.append(self)
|
105
|
15 self.basicblocks = []
|
|
16 self.arguments = []
|
|
17 # Construct formal arguments depending on function type
|
70
|
18
|
105
|
19 BasicBlocks = property(lambda self: self.basicblocks)
|
|
20 Arguments = property(lambda self: self.arguments)
|
|
21 ReturnType = property(lambda self: self.functiontype.returnType)
|
|
22 FunctionType = property(lambda self: self.functiontype)
|
|
23
|