#NEWLINE# def make_constant_array( self , builder , typ , ary ) : #NEWLINE# #INDENT# '\n        Create an array structure reifying the given constant array.\n        A low-level contiguous array constant is created in the LLVM IR.\n        ' #NEWLINE# assert ( typ . layout == 'C' ) #NEWLINE# flat = ary . flatten ( ) #NEWLINE# consts = Constant . array ( Type . int ( 8 ) , bytearray ( flat . data ) ) #NEWLINE# data = cgutils . global_constant ( builder , '.const.array.data' , consts ) #NEWLINE# llintp = self . get_value_type ( types . intp ) #NEWLINE# shapevals = [ self . get_constant ( types . intp , s ) for s in ary . shape ] #NEWLINE# cshape = Constant . array ( llintp , shapevals ) #NEWLINE# contig = numpy . ascontiguousarray ( ary ) #NEWLINE# stridevals = [ self . get_constant ( types . intp , s ) for s in contig . strides ] #NEWLINE# cstrides = Constant . array ( llintp , stridevals ) #NEWLINE# cary = self . make_array ( typ ) ( self , builder ) #NEWLINE# rt_addr = self . get_constant ( types . uintp , id ( ary ) ) . inttoptr ( self . get_value_type ( types . pyobject ) ) #NEWLINE# intp_itemsize = self . get_constant ( types . intp , ary . dtype . itemsize ) #NEWLINE# self . populate_array ( cary , data = builder . bitcast ( data , cary . data . type ) , shape = cshape , strides = cstrides , itemsize = intp_itemsize , parent = rt_addr , meminfo = None ) #NEWLINE# return cary . _getvalue ( )