13 if( astIsVAR(
l ) )
then
14 function =
l->var_.ofs
17 function =
l->idx.ofs +
l->r->var_.ofs + _
18 symbGetArrayDiff(
l->sym ) + symbGetOfs(
l->sym )
23 dim as ASTNODE
ptr n =
any
31 typeAddrOf( astGetFullType(
l ) ), _
43 if(
l->sym <> NULL )
then
44 symbSetIsAccessed(
l->sym )
51 dim as IRVREG
ptr vr =
any
52 dim as FBSYMBOL
ptr sym =
any
53 dim as ASTNODE
ptr l =
any
56 if( sym <> NULL )
then
57 symbSetIsAccessed( sym )
61 vr = irAllocVROFS( astGetDataType( n ), n->subtype, sym, n->ofs.ofs )
67 if( astIsIDX(
l ) )
then
78 dim as ASTNODE
ptr n =
any, t =
any
90 case AST_NODECLASS_PTRCHK
98 case AST_NODECLASS_BOP
102 case AST_NODECLASS_PTRCHK
108 case AST_NODECLASS_BOP
119 dim as ASTNODE
ptr n =
any
120 dim as integer dtype =
any
121 dim as FBSYMBOL
ptr subtype =
any
128 dim as ASTNODE
ptr t =
l
129 if(
l->
class = AST_NODECLASS_CONV )
then
130 if(
l->
cast.doconv = FALSE )
then
137 select case( t->
class )
138 case AST_NODECLASS_DEREF
139 if( env.clopt.extraerrchk )
then
147 if( t->
ptr.ofs = 0 )
then
157 case AST_NODECLASS_FIELD
159 if( t->
l->
class = AST_NODECLASS_DEREF )
then
160 if( env.clopt.extraerrchk )
then
166 if( t->
l->
l = NULL )
then
174 case AST_NODECLASS_VAR
175 dim as FBSYMBOL
ptr s =
any
180 if( (symbIsLocal( s ) = FALSE)
or _
181 ((symbGetAttrib( s )
and (FB_SYMBATTRIB_SHARED
or _
182 FB_SYMBATTRIB_COMMON
or _
183 FB_SYMBATTRIB_STATIC)) <> 0) )
then
188 case AST_NODECLASS_IDX
199 if( t->
l = NULL )
then
200 dim as FBSYMBOL
ptr s =
any
203 if( (symbIsLocal( s ) = FALSE)
or _
204 ((symbGetAttrib( s )
and (FB_SYMBATTRIB_SHARED
or _
205 FB_SYMBATTRIB_COMMON
or _
206 FB_SYMBATTRIB_STATIC)) <> 0) )
then
208 if( symbGetIsDynamic( s ) = FALSE )
then
218 dtype = typeAddrOf(
l->dtype )
225 return astNewCONV( dtype, subtype, n, AST_CONVOPT_DONTCHKPTR )
229 n =
astNewNode( AST_NODECLASS_ADDROF, dtype, subtype )
230 n->op.op = AST_OP_ADDROF
237 dim as ASTNODE
ptr p =
any
238 dim as IRVREG
ptr v1 =
any, vr =
any
247 if( ast.doemit )
then
249 if( (irIsREG( v1 ) = FALSE)
or _
250 (typeGetClass(v1->dtype) <> FB_DATACLASS_INTEGER)
or _
251 (typeGetSize(v1->dtype) <> env.pointersize) )
then
253 vr = irAllocVREG( astGetDataType( n ), n->subtype )
254 irEmitADDR( AST_OP_ADDROF, v1, vr )