| ︙ | | | ︙ | |
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
RegisterBuiltinFunc< Intrinsic< bool ( Value, bool, bool ) > >( e, orOp,
[]( auto&& c, auto&& b, auto&& lhs, auto&& rhs )
{
return BuildComputedValue( GetValueType< bool >(), lhs, rhs, Or( c.locationId() ) );
} );
RegisterBuiltinFunc< Intrinsic< bool ( TypeWrapper< ptr< CodeBuilder > >, bool, bool ) > >( e, orOp,
[]( auto&& c, auto&& b, auto&& lhs, auto&& rhs )
{
auto cb = *FromValue< TypeWrapper< ptr< CodeBuilder > > >( b );
const auto& cfg = cb->cfg();
// Build the control flow for shortcut evaluation.
const auto& predBB = cfg->currentBB();
|
>
|
|
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
RegisterBuiltinFunc< Intrinsic< bool ( Value, bool, bool ) > >( e, orOp,
[]( auto&& c, auto&& b, auto&& lhs, auto&& rhs )
{
return BuildComputedValue( GetValueType< bool >(), lhs, rhs, Or( c.locationId() ) );
} );
// TODO_SSA: revise this
/*RegisterBuiltinFunc< Intrinsic< bool ( TypeWrapper< ptr< CodeBuilder > >, bool, bool ) > >( e, orOp,
[]( auto&& c, auto&& b, auto&& lhs, auto&& rhs )
{
auto cb = *FromValue< TypeWrapper< ptr< CodeBuilder > > >( b );
const auto& cfg = cb->cfg();
// Build the control flow for shortcut evaluation.
const auto& predBB = cfg->currentBB();
|
| ︙ | | | ︙ | |
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
pSuccBB->append( move( phi ) );
cfg->setCurrentBB( pSuccBB );
// Build the result val which pulls the temporary created above.
return BuildComputedValue( GetValueType< bool >(),
GetTemporary( GetValueType< bool >(), resultIndex, c.locationId() ) );
} );
BuildParseRule( e, "&"_sid,
LeftAssInfixOp( "operator_and"_sid, precedence::AndOp,
BuildGenericTupleOperator(),
// ct_int and
ForType< BigInt >(
|
|
|
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
pSuccBB->append( move( phi ) );
cfg->setCurrentBB( pSuccBB );
// Build the result val which pulls the temporary created above.
return BuildComputedValue( GetValueType< bool >(),
GetTemporary( GetValueType< bool >(), resultIndex, c.locationId() ) );
} );*/
BuildParseRule( e, "&"_sid,
LeftAssInfixOp( "operator_and"_sid, precedence::AndOp,
BuildGenericTupleOperator(),
// ct_int and
ForType< BigInt >(
|
| ︙ | | | ︙ | |
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
|
RegisterBuiltinFunc< Intrinsic< bool ( Value, bool, bool ) > >( e, andOp,
[]( auto&& c, auto&& b, auto&& lhs, auto&& rhs )
{
return BuildComputedValue( GetValueType< bool >(), lhs, rhs, And( c.locationId() ) );
} );
RegisterBuiltinFunc< Intrinsic< bool ( TypeWrapper< ptr< CodeBuilder > >, bool, bool ) > >( e, andOp,
[]( auto&& c, auto&& b, auto&& lhs, auto&& rhs )
{
auto cb = *FromValue< TypeWrapper< ptr< CodeBuilder > > >( b );
const auto& cfg = cb->cfg();
// Build the control flow for shortcut evaluation.
const auto& predBB = cfg->currentBB();
|
>
|
|
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
|
RegisterBuiltinFunc< Intrinsic< bool ( Value, bool, bool ) > >( e, andOp,
[]( auto&& c, auto&& b, auto&& lhs, auto&& rhs )
{
return BuildComputedValue( GetValueType< bool >(), lhs, rhs, And( c.locationId() ) );
} );
// TODO_SSA revise this
/* RegisterBuiltinFunc< Intrinsic< bool ( TypeWrapper< ptr< CodeBuilder > >, bool, bool ) > >( e, andOp,
[]( auto&& c, auto&& b, auto&& lhs, auto&& rhs )
{
auto cb = *FromValue< TypeWrapper< ptr< CodeBuilder > > >( b );
const auto& cfg = cb->cfg();
// Build the control flow for shortcut evaluation.
const auto& predBB = cfg->currentBB();
|
| ︙ | | | ︙ | |
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
|
pSuccBB->append( move( phi ) );
cfg->setCurrentBB( pSuccBB );
// Build the result val which pulls the temporary created above.
return BuildComputedValue( GetValueType< bool >(),
GetTemporary( GetValueType< bool >(), resultIndex, c.locationId() ) );
} );
BuildParseRule( e, "<<"_sid,
LeftAssInfixOp( "operator_shift_left"_sid, precedence::BitShiftOp,
BuildGenericTupleOperator(),
// ct_int left shift
ForTypes< BigInt, uint32_t >(
|
|
|
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
|
pSuccBB->append( move( phi ) );
cfg->setCurrentBB( pSuccBB );
// Build the result val which pulls the temporary created above.
return BuildComputedValue( GetValueType< bool >(),
GetTemporary( GetValueType< bool >(), resultIndex, c.locationId() ) );
} );*/
BuildParseRule( e, "<<"_sid,
LeftAssInfixOp( "operator_shift_left"_sid, precedence::BitShiftOp,
BuildGenericTupleOperator(),
// ct_int left shift
ForTypes< BigInt, uint32_t >(
|
| ︙ | | | ︙ | |