15 listInit( @ast.
call.tmpstrlist, 32,
len( AST_TMPSTRLIST_ITEM ), LIST_FLAGS_NOCLEAR )
25 byval sym
as FBSYMBOL
ptr, _
26 byval ptrexpr
as ASTNODE
ptr =
NULL _
29 dim as ASTNODE
ptr n =
any
30 dim as FBRTLCALLBACK callback =
any
31 dim as integer dtype =
any
32 dim as FBSYMBOL
ptr subtype =
any
37 dtype = symbGetFullType( sym )
38 subtype = symbGetSubType( sym )
41 symbSetIsAccessed( sym )
44 n =
astNewNode( AST_NODECLASS_CALL, dtype, subtype )
51 if( sym <>
NULL )
then
52 n->
call.currarg = symbGetProcHeadParam( sym )
53 n->
call.isrtl = symbGetIsRTL( sym )
55 callback = symbGetProcCallback( sym )
56 if( callback <>
NULL )
then
60 n->
call.currarg =
NULL
64 n->
call.argtail =
NULL
65 n->
call.strtail =
NULL
70 n->
call.tmpres =
symbAddTempVar( FB_DATATYPE_STRUCT, symbGetSubtype( sym ) )
81 byval procexpr
as ASTNODE
ptr, _
82 byval instptr
as ASTNODE
ptr _
85 dim as ASTNODE
ptr n =
any
88 astGetFullType( instptr ), _
89 astGetSubtype( instptr ) )
98 dim as ASTNODE
ptr t =
any
99 dim as AST_TMPSTRLIST_ITEM
ptr n =
any, p =
any
104 do while( n <>
NULL )
107 if( n->srctree <>
NULL )
then
125 static as integer reclevel = 0
126 dim as ASTNODE
ptr arg =
any, nextarg =
any, l =
any
127 dim as FBSYMBOL
ptr proc =
any
128 dim as integer bytestopop =
any, bytestoalign =
any
129 dim as IRVREG
ptr vr =
any, v1 =
any
146 bytestopop +=
symbCalcArgLen( l->dtype, l->subtype, arg->arg.mode )
150 bytestoalign = (16 - (bytestopop
and (16-1)))
and (16-1)
151 if( bytestoalign > 0 )
then
152 if( ast.doemit )
then
153 irEmitSTACKALIGN( bytestoalign )
169 if( symbGetProcMode( proc ) = FB_FUNCMODE_CDECL )
then
170 bytestopop +=
symbCalcArgLen( l->dtype, l->subtype, arg->arg.mode )
173 if( l->
class = AST_NODECLASS_CONV )
then
174 astUpdateCONVFD2FS( l, arg->dtype, FALSE )
181 if( ast.doemit )
then
182 irEmitPUSHARG( arg->sym, v1, arg->arg.lgt, reclevel )
193 if( (symbGetProcMode( proc ) = FB_FUNCMODE_CDECL)
and _
194 ((env.target.options
and FB_TARGETOPT_CALLEEPOPSHIDDENPTR) = 0) )
then
195 bytestopop += env.pointersize
197 if( ast.doemit )
then
212 irEmitPUSHARG(
NULL, v1, 0, reclevel )
216 if( ast.doemit )
then
218 if( astGetDataType( n ) = FB_DATATYPE_VOID )
then
223 assert(
iif( symbProcReturnsByref( proc ), _
224 astGetDataType( n ) = typeGetDtAndPtrOnly( symbGetProcRealType( proc ) ), _
227 vr = irAllocVREG( typeGetDtAndPtrOnly( symbGetProcRealType( proc ) ), _
228 symbGetProcRealSubtype( proc ) )
230 if( proc->proc.returnMethod <> FB_RETURN_SSE )
then
231 vr->regFamily = IR_REG_FPU_STACK
237 bytestopop += bytestoalign
245 if( ast.doemit )
then
246 irEmitCALLPTR( v1, vr, bytestopop, reclevel )
249 if( ast.doemit )
then
250 irEmitCALLFUNCT( proc, bytestopop, vr, reclevel )
263 dim as IRVREG
ptr vr =
any
279 byval n
as ASTNODE
ptr, _
280 byval c
as ASTNODE
ptr _
285 dim as AST_TMPSTRLIST_ITEM
ptr sn =
any, sc =
any
287 c->
call.strtail =
NULL
289 do while( sn <>
NULL )
294 sc->prev = c->
call.strtail
306 if( n->r =
NULL )
then
318 byval n
as ASTNODE
ptr _
323 dim as AST_TMPSTRLIST_ITEM
ptr s =
any, p =
any
325 do while( s <>
NULL )
340 byval n
as ASTNODE
ptr, _
341 byval old_sym
as FBSYMBOL
ptr, _
342 byval new_sym
as FBSYMBOL
ptr _
346 if( n->
call.tmpres = old_sym )
then
347 n->
call.tmpres = new_sym
352 dim as AST_TMPSTRLIST_ITEM
ptr s =
any
354 do while( s <>
NULL )
355 if( s->sym = old_sym )
then
369 assert( astIsCALL( expr ) )
373 astNewVAR( expr->
call.tmpres, 0, astGetFullType( expr ), astGetSubtype( expr ) ), _
379 dim as FBSYMBOL
ptr tmp =
any
381 assert( astIsCALL( expr ) )
382 assert( astGetDataType( expr ) = FB_DATATYPE_STRUCT )
383 assert( symbProcReturnsByref( expr->sym ) = FALSE )
404 dim as integer dtype =
any
405 dim as FBSYMBOL
ptr subtype =
any
409 if( astIsCALL( expr ) = FALSE )
then
414 if( symbProcReturnsByref( expr->sym ) = FALSE )
then
426 dtype = symbGetProcRealType( expr->sym )
427 subtype = symbGetProcRealSubtype( expr->sym )
429 if( typeGetDtOnly( dtype ) = FB_DATATYPE_FWDREF )
then
431 dtype = typeJoinDtOnly( dtype, FB_DATATYPE_INTEGER )
442 if( astIsDEREF( expr ) )
then
443 if( astIsCALL( expr->l ) )
then
444 function = symbProcReturnsByref( expr->l->sym )