15 byval op as integer, _
16 byval l as ASTNODE
ptr, _
17 byval r
as ASTNODE
ptr, _
18 byval bytes
as longint _
21 dim as ASTNODE
ptr n =
any
23 dim as uinteger blkmaxlen = irGetOptionValue( IR_OPTIONVALUE_MAXMEMBLOCKLEN )
25 dim as ulongint lgt = bytes
26 if(
op = AST_OP_MEMCLEAR )
then
27 if( astIsCONST( r ) )
then
28 lgt = astConstGetInt( r )
36 if( lgt > blkmaxlen )
then
39 if(
op = AST_OP_MEMMOVE )
then
45 n =
astNewNode( AST_NODECLASS_MEM, FB_DATATYPE_INVALID )
57 byval tmp
as FBSYMBOL
ptr, _
58 byval elementsexpr
as ASTNODE
ptr, _
59 byval dtype
as integer, _
60 byval subtype
as FBSYMBOL
ptr _
63 dim as FBSYMBOL
ptr cnt =
any, label =
any, iter =
any
64 dim as ASTNODE
ptr tree =
any
95 byval elementsexpr
as ASTNODE
ptr, _
96 byref elementstreecount
as integer _
99 if( elementstreecount > 1 )
then
102 function = elementsexpr
105 elementstreecount -= 1
106 assert( elementstreecount >= 0 )
112 byval op as AST_OP, _
113 byval tmp
as FBSYMBOL
ptr, _
114 byval elementsexpr
as ASTNODE
ptr, _
115 byval initexpr
as ASTNODE
ptr, _
116 byval dtype
as integer, _
117 byval subtype
as FBSYMBOL
ptr, _
118 byval do_clear
as integer, _
119 byval newexpr
as ASTNODE
ptr _
131 dim as ASTNODE
ptr lenexpr =
any, tree =
any
132 dim as integer save_elmts =
any, init =
any, elementstreecount =
any
137 elementstreecount = 0
145 elseif( astIsCALLCTOR( initexpr ) )
then
152 if(
op = AST_OP_NEW_VEC )
then
153 init = INIT_DEFCTORLIST
154 elementstreecount += 1
159 elseif( do_clear )
then
161 elementstreecount += 1
167 if(
op = AST_OP_NEW_VEC )
then
171 if( newexpr = NULL )
then
172 elementstreecount += 1
175 if( save_elmts )
then
176 elementstreecount += 1
180 if( elementstreecount > 1 )
then
188 if( newexpr = NULL )
then
193 if( save_elmts )
then
195 lenexpr =
astNewBOP( AST_OP_ADD, lenexpr, _
196 astNewCONSTi( typeGetSize( FB_DATATYPE_INTEGER ), FB_DATATYPE_UINT ) )
200 if( newexpr = NULL )
then
209 if( save_elmts )
then
214 hElements( elementsexpr, elementstreecount ) ) )
219 astNewVAR( tmp, , typeAddrOf( FB_DATATYPE_VOID ) ), _
224 select case as const( init )
226 assert( astIsTYPEINI( initexpr ) )
228 AST_INIOPT_ISINI
or AST_INIOPT_DODEREF )
237 case INIT_DEFCTORLIST
247 astNewCONV( FB_DATATYPE_UINT, NULL, lenexpr ) )
259 byval ptrexpr
as ASTNODE
ptr, _
260 byval dtype
as integer, _
261 byval subtype
as FBSYMBOL
ptr _
264 dim as FBSYMBOL
ptr cnt =
any, label =
any, iter =
any, elmts =
any
265 dim as ASTNODE
ptr tree =
any, expr =
any
277 astNewCONV( typeAddrOf( FB_DATATYPE_INTEGER ), NULL, _
280 astNewCONSTi( -typeGetSize( FB_DATATYPE_INTEGER ) ) ), _
281 AST_CONVOPT_DONTCHKPTR ) ) )
286 AST_OPOPT_DEFAULT
or AST_OPOPT_DOPTRARITH ) ) )
305 byval op as AST_OP, _
306 byval ptrexpr
as ASTNODE
ptr, _
307 byval dtype
as integer, _
308 byval subtype
as FBSYMBOL
ptr _
311 dim as ASTNODE
ptr tree =
any
312 dim as FBSYMBOL
ptr label =
any
327 label, AST_OPOPT_NONE ) )
331 if(
op = AST_OP_DEL_VEC )
then
350 dim as ASTNODE
ptr l =
any, r =
any
351 dim as IRVREG
ptr v1 =
any, v2 =
any
370 if( ast.doemit )
then
371 irEmitMEM( n->mem.
op, v1, v2, n->mem.bytes )