18 byval op as integer, _
19 byval label
as FBSYMBOL
ptr, _
20 byval l as ASTNODE
ptr _
23 dim as ASTNODE
ptr n =
any
24 dim as integer dtype =
any
27 dtype = FB_DATATYPE_INVALID
29 dtype = astGetFullType(
l )
39 n->
op.options = AST_OPOPT_ALLOCRES
46 byval n
as ASTNODE
ptr _
49 dim as ASTNODE
ptr l =
any
50 dim as IRVREG
ptr vr =
any
63 if( n->
op.ex = NULL )
then
70 irEmitCALLPTR( vr, NULL, 0, -1 )
77 irEmitBRANCH( n->
op.
op, n->
op.ex )
90 byval l as ASTNODE
ptr, _
91 byval tbsym
as FBSYMBOL
ptr, _
92 byval values1
as ulongint ptr, _
93 byval labels1
as FBSYMBOL
ptr ptr, _
94 byval labelcount
as integer, _
95 byval deflabel
as FBSYMBOL
ptr, _
96 byval minval
as ulongint, _
97 byval maxval
as ulongint _
100 dim as ASTNODE
ptr n =
any, tree =
any
101 dim as ulongint ptr values =
any
102 dim as FBSYMBOL
ptr ptr labels =
any
109 if( labelcount > 0 )
then
111 values =
callocate(
sizeof( *values ) * labelcount )
112 labels =
callocate(
sizeof( *labels ) * labelcount )
113 for i
as integer = 0
to labelcount - 1
114 values[i] = values1[i]
115 labels[i] = labels1[i]
122 n =
astNewNode( AST_NODECLASS_JMPTB, FB_DATATYPE_INVALID )
126 n->jmptb.values = values
127 n->jmptb.labels = labels
128 n->jmptb.labelcount = labelcount
129 n->jmptb.deflabel = deflabel
130 n->jmptb.minval = minval
131 n->jmptb.maxval = maxval
137 dim as IRVREG
ptr v1 =
any
142 if( ast.doemit )
then
143 irEmitJMPTB( v1, n->sym, n->jmptb.values, n->jmptb.labels, _
144 n->jmptb.labelcount, n->jmptb.deflabel, _
145 n->jmptb.minval, n->jmptb.maxval )
148 deallocate( n->jmptb.values )
149 deallocate( n->jmptb.labels )
156 byval tempvar
as FBSYMBOL
ptr, _
157 byval values1
as ulongint ptr, _
158 byval labels1
as FBSYMBOL
ptr ptr, _
159 byval labelcount
as integer, _
160 byval deflabel
as FBSYMBOL
ptr, _
161 byval minval
as ulongint, _
162 byval maxval
as ulongint _
165 dim as ASTNODE
ptr tree =
any,
l =
any
166 static as FBARRAYDIM dTB(0)
167 dim as FBSYMBOL
ptr tbsym =
any
169 assert( symbGetType( tempvar ) = FB_DATATYPE_UINT
or symbGetType( tempvar ) = FB_DATATYPE_ULONGINT )
175 select case( env.clopt.backend )
176 case FB_BACKEND_GAS, FB_BACKEND_LLVM
177 if( labelcount <= 0 )
then
199 if( env.clopt.backend = FB_BACKEND_GAS )
then
201 typeAddrOf( FB_DATATYPE_VOID ), NULL, 0, _
202 1, dTB(), FB_SYMBATTRIB_SHARED )
203 symbSetIsJumpTb( tbsym )
204 symbSetIsInitialized( tbsym )
214 deflabel, AST_OPOPT_NONE ) )
223 typeAddrOf( FB_DATATYPE_VOID ), NULL ) ) )
230 values1, labels1, labelcount, deflabel, minval, maxval ) )
237 byval label
as FBSYMBOL
ptr, _
238 byval tree
as ASTNODE
ptr _
241 dim as ASTNODE
ptr n =
any
243 n =
astNewNode( AST_NODECLASS_LOOP, FB_DATATYPE_INVALID )
251 n->
op.
op = AST_OP_FOR