comparison python/ppci/core/function.py @ 106:f2d980eef509

improved code generation
author Windel Bouwman
date Mon, 31 Dec 2012 18:26:56 +0100
parents 6a303f835c6d
children 9e552d34bd60
comparison
equal deleted inserted replaced
105:6a303f835c6d 106:f2d980eef509
8 class Function: 8 class Function:
9 def __init__(self, functiontype, name, module): 9 def __init__(self, functiontype, name, module):
10 self.functiontype = functiontype 10 self.functiontype = functiontype
11 self.name = name 11 self.name = name
12 self.module = module 12 self.module = module
13
14 self.module.Functions.append(self)
13 self.basicblocks = [] 15 self.basicblocks = []
14 self.arguments = [] 16 self.arguments = []
15 # Construct formal arguments depending on function type 17 # Construct formal arguments depending on function type
16
17 18
18 BasicBlocks = property(lambda self: self.basicblocks) 19 BasicBlocks = property(lambda self: self.basicblocks)
19 Arguments = property(lambda self: self.arguments) 20 Arguments = property(lambda self: self.arguments)
20 ReturnType = property(lambda self: self.functiontype.returnType) 21 ReturnType = property(lambda self: self.functiontype.returnType)
21 FunctionType = property(lambda self: self.functiontype) 22 FunctionType = property(lambda self: self.functiontype)