File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -491,6 +491,9 @@ bool DisjunctionStep::shouldStopAt(const DisjunctionChoice &choice) const {
491
491
}
492
492
493
493
bool swift::isSIMDOperator (ValueDecl *value) {
494
+ if (!value)
495
+ return false ;
496
+
494
497
auto func = dyn_cast<FuncDecl>(value);
495
498
if (!func)
496
499
return false ;
@@ -556,10 +559,8 @@ bool DisjunctionStep::shortCircuitDisjunctionAt(
556
559
// If we have an operator from the SIMDOperators module, and the prior
557
560
// choice was not from the SIMDOperators module, we're done.
558
561
if (currentChoice->getKind () == ConstraintKind::BindOverload &&
559
- currentChoice->getOverloadChoice ().isDecl () &&
560
562
isSIMDOperator (currentChoice->getOverloadChoice ().getDecl ()) &&
561
563
lastSuccessfulChoice->getKind () == ConstraintKind::BindOverload &&
562
- lastSuccessfulChoice->getOverloadChoice ().isDecl () &&
563
564
!isSIMDOperator (lastSuccessfulChoice->getOverloadChoice ().getDecl ()) &&
564
565
!ctx.LangOpts .SolverEnableOperatorDesignatedTypes ) {
565
566
return true ;
Original file line number Diff line number Diff line change @@ -1459,7 +1459,7 @@ static ArrayRef<OverloadChoice> partitionSIMDOperators(
1459
1459
// Check whether we have any SIMD operators.
1460
1460
bool foundSIMDOperator = false ;
1461
1461
for (const auto &choice : choices) {
1462
- if (choice. isDecl () && isSIMDOperator (choice.getDecl ())) {
1462
+ if (isSIMDOperator (choice.getDecl ())) {
1463
1463
foundSIMDOperator = true ;
1464
1464
break ;
1465
1465
}
@@ -1471,8 +1471,7 @@ static ArrayRef<OverloadChoice> partitionSIMDOperators(
1471
1471
scratch.assign (choices.begin (), choices.end ());
1472
1472
std::stable_partition (scratch.begin (), scratch.end (),
1473
1473
[](const OverloadChoice &choice) {
1474
- return !choice.isDecl () ||
1475
- !isSIMDOperator (choice.getDecl ());
1474
+ return !isSIMDOperator (choice.getDecl ());
1476
1475
});
1477
1476
1478
1477
return scratch;
You can’t perform that action at this time.
0 commit comments