#NEWLINE# def visit_Fun( self , node ) : #NEWLINE# #INDENT# rettype = to_lltype ( self . retty ) #NEWLINE# argtypes = map ( to_lltype , self . argtys ) #NEWLINE# func_name = mangler ( node . fname , self . argtys ) #NEWLINE# self . start_function ( func_name , module , rettype , argtypes ) #NEWLINE# for ( ar , llarg , argty ) in zip ( node . args , self . function . args , self . argtys ) : #NEWLINE# #INDENT# name = ar . id #NEWLINE# llarg . name = name #NEWLINE# if is_array ( argty ) : #NEWLINE# #INDENT# zero = self . const ( 0 ) #NEWLINE# one = self . const ( 1 ) #NEWLINE# two = self . const ( 2 ) #NEWLINE# data = self . builder . gep ( llarg , [ zero , zero ] , name = ( name + '_data' ) ) #NEWLINE# dims = self . builder . gep ( llarg , [ zero , one ] , name = ( name + '_dims' ) ) #NEWLINE# shape = self . builder . gep ( llarg , [ zero , two ] , name = ( name + '_strides' ) ) #NEWLINE# self . arrays [ name ] [ 'data' ] = self . builder . load ( data ) #NEWLINE# self . arrays [ name ] [ 'dims' ] = self . builder . load ( dims ) #NEWLINE# self . arrays [ name ] [ 'shape' ] = self . builder . load ( shape ) #NEWLINE# self . locals [ name ] = llarg #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# argref = self . builder . alloca ( to_lltype ( argty ) ) #NEWLINE# self . builder . store ( llarg , argref ) #NEWLINE# self . locals [ name ] = argref #NEWLINE# #UNINDENT# #UNINDENT# if ( rettype is not void_type ) : #NEWLINE# #INDENT# self . locals [ 'retval' ] = self . builder . alloca ( rettype , name = 'retval' ) #NEWLINE# #UNINDENT# map ( self . visit , node . body ) #NEWLINE# self . end_function ( )