@@ -4427,12 +4427,12 @@ struct AsyncHandlerParamDesc : public AsyncHandlerDesc {
4427
4427
}
4428
4428
};
4429
4429
4430
- enum class ConditionType { INVALID, NIL, NOT_NIL };
4430
+ enum class ConditionType { NIL, NOT_NIL };
4431
4431
4432
4432
// / Finds the `Subject` being compared to in various conditions. Also finds any
4433
4433
// / pattern that may have a bound name.
4434
4434
struct CallbackCondition {
4435
- ConditionType Type = ConditionType::INVALID ;
4435
+ Optional< ConditionType> Type;
4436
4436
const Decl *Subject = nullptr ;
4437
4437
const Pattern *BindPattern = nullptr ;
4438
4438
// Bit of a hack. When the `Subject` is a `Result` type we use this to
@@ -4504,7 +4504,7 @@ struct CallbackCondition {
4504
4504
}
4505
4505
}
4506
4506
4507
- bool isValid () const { return Type != ConditionType::INVALID ; }
4507
+ bool isValid () const { return Type. hasValue () ; }
4508
4508
4509
4509
// / Given an `if` condition `Cond` and a set of `Decls`, find any
4510
4510
// / `CallbackCondition`s in `Cond` that use one of those `Decls` and add them
@@ -4902,10 +4902,10 @@ struct CallbackClassifier {
4902
4902
ThenBlock = ElseBlock;
4903
4903
ElseBlock = TempBlock;
4904
4904
} else {
4905
- ConditionType CondType = ConditionType::INVALID ;
4905
+ Optional< ConditionType> CondType;
4906
4906
for (auto &Entry : CallbackConditions) {
4907
4907
if (IsResultParam || Entry.second .Subject != ErrParam) {
4908
- if (CondType == ConditionType::INVALID ) {
4908
+ if (! CondType) {
4909
4909
CondType = Entry.second .Type ;
4910
4910
} else if (CondType != Entry.second .Type ) {
4911
4911
// Similar to the unknown conditions case. Add the whole if unless
0 commit comments