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
|
110
|
8 class Function(GlobalValue):
|
104
|
9 def __init__(self, functiontype, name, module):
|
110
|
10 super().__init__()
|
104
|
11 self.functiontype = functiontype
|
|
12 self.name = name
|
|
13 self.module = module
|
106
|
14
|
|
15 self.module.Functions.append(self)
|
105
|
16 self.basicblocks = []
|
|
17 self.arguments = []
|
|
18 # Construct formal arguments depending on function type
|
70
|
19
|
105
|
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
|