Skip to content

Commit 6125d25

Browse files
committed
[NFC] Silence Non-Exhaustive Switch Warnings on Windows
1 parent 804459d commit 6125d25

16 files changed

+21
-0
lines changed

include/swift/AST/Decl.h

+1
Original file line numberDiff line numberDiff line change
@@ -3762,6 +3762,7 @@ struct SelfReferencePosition final {
37623762
case Contravariant:
37633763
return Covariant;
37643764
}
3765+
llvm_unreachable("unhandled self reference position!");
37653766
}
37663767

37673768
explicit operator bool() const { return kind > None; }

include/swift/AST/ForeignErrorConvention.h

+1
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class ForeignErrorConvention {
198198
case NonNilError:
199199
return false;
200200
}
201+
llvm_unreachable("unhandled foreign error kind!");
201202
}
202203

203204
bool operator==(ForeignErrorConvention other) const {

include/swift/Demangling/TypeLookupError.h

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ class TypeLookupError {
150150
delete castContext;
151151
return nullptr;
152152
}
153+
llvm_unreachable("unhandled command!");
153154
};
154155
}
155156

include/swift/Sema/ConstraintSystem.h

+2
Original file line numberDiff line numberDiff line change
@@ -1907,6 +1907,7 @@ class SolutionApplicationTarget {
19071907
case Kind::patternBinding:
19081908
return patternBinding;
19091909
}
1910+
llvm_unreachable("invalid case label type");
19101911
}
19111912

19121913
VarDecl *getAsUninitializedWrappedVar() const {
@@ -1921,6 +1922,7 @@ class SolutionApplicationTarget {
19211922
case Kind::uninitializedWrappedVar:
19221923
return uninitializedWrappedVar;
19231924
}
1925+
llvm_unreachable("invalid case label type");
19241926
}
19251927

19261928
BraceStmt *getFunctionBody() const {

lib/AST/AutoDiff.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ bool swift::operator==(const TangentPropertyInfo::Error &lhs,
462462
case TangentPropertyInfo::Error::Kind::TangentPropertyWrongType:
463463
return lhs.getType()->isEqual(rhs.getType());
464464
}
465+
llvm_unreachable("unhandled tangent property!");
465466
}
466467

467468
void swift::simple_display(llvm::raw_ostream &os, TangentPropertyInfo info) {

lib/AST/ClangTypeConverter.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ const clang::Type *ClangTypeConverter::getFunctionType(
207207
case SILFunctionType::Representation::Closure:
208208
llvm_unreachable("Expected a C-compatible representation.");
209209
}
210+
llvm_unreachable("unhandled representation!");
210211
}
211212

212213
clang::QualType ClangTypeConverter::convertMemberType(NominalTypeDecl *DC,

lib/AST/TypeCheckRequests.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,7 @@ bool ActorIsolation::requiresSubstitution() const {
14971497
case GlobalActor:
14981498
return getGlobalActor()->hasTypeParameter();
14991499
}
1500+
llvm_unreachable("unhandled actor isolation kind!");
15001501
}
15011502

15021503
ActorIsolation ActorIsolation::subst(SubstitutionMap subs) const {
@@ -1509,6 +1510,7 @@ ActorIsolation ActorIsolation::subst(SubstitutionMap subs) const {
15091510
case GlobalActor:
15101511
return forGlobalActor(getGlobalActor().subst(subs));
15111512
}
1513+
llvm_unreachable("unhandled actor isolation kind!");
15121514
}
15131515

15141516
void swift::simple_display(

lib/Driver/DarwinToolChains.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ bool jobMatchesFilter(LinkKind jobKind, BackDeployLibFilter filter) {
364364
case BackDeployLibFilter::all:
365365
return true;
366366
}
367+
llvm_unreachable("unhandled back deploy lib filter!");
367368
}
368369

369370
}

lib/IDE/APIDigesterData.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ StringRef swift::ide::api::getDeclKindStr(const DeclKind Value, bool lower) {
5656
}
5757
#include "swift/AST/DeclNodes.def"
5858
}
59+
llvm_unreachable("Unhandled DeclKind in switch.");
5960
} else {
6061
return getDeclKindStrRaw(Value);
6162
}

lib/IRGen/MetadataLayout.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ ClassMetadataLayout::getMethodInfo(IRGenFunction &IGF, SILDeclRef method) const{
414414
case MethodInfo::Kind::DirectImpl:
415415
return MethodInfo(stored.TheImpl);
416416
}
417+
llvm_unreachable("unhandled method info kind!");
417418
}
418419

419420
Offset ClassMetadataLayout::getFieldOffset(IRGenFunction &IGF,

lib/IRGen/MetadataRequest.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ static MetadataResponse emitNominalPrespecializedGenericMetadataRef(
616616
return MetadataResponse::handle(IGF, request, call);
617617
}
618618
}
619+
llvm_unreachable("unhandled metadata canonicality");
619620
}
620621

621622
static llvm::Value *

lib/SILOptimizer/Differentiation/PullbackCloner.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ class PullbackCloner::Implementation final
336336
case AdjointValueKind::Concrete:
337337
return val.getConcreteValue();
338338
}
339+
llvm_unreachable("unhandled adjoint value kind!");
339340
}
340341

341342
/// Materializes an adjoint value indirectly to a SIL buffer.

lib/SILOptimizer/SemanticARC/OwnershipPhiOperand.h

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class LLVM_LIBRARY_VISIBILITY OwnershipPhiOperand {
8888
case Kind::Struct:
8989
return false;
9090
}
91+
llvm_unreachable("unhandled operand kind!");
9192
}
9293

9394
bool operator<(const OwnershipPhiOperand &other) const {
@@ -113,6 +114,7 @@ class LLVM_LIBRARY_VISIBILITY OwnershipPhiOperand {
113114
});
114115
}
115116
}
117+
llvm_unreachable("unhandled operand kind!");
116118
}
117119
};
118120

lib/SILOptimizer/Transforms/AllocBoxToStack.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ specializeApplySite(SILOptFunctionBuilder &FuncBuilder, ApplySite Apply,
984984
GenericSpecializationInformation::create(ApplyInst, Builder));
985985
}
986986
}
987+
llvm_unreachable("unhandled apply inst kind!");
987988
}
988989

989990
static void rewriteApplySites(AllocBoxToStackState &pass) {

lib/Sema/TypeCheckConcurrency.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ void swift::checkActorIsolation(const Expr *expr, const DeclContext *dc) {
825825
// Okay.
826826
return false;
827827
}
828+
llvm_unreachable("unhandled actor isolation kind!");
828829
}
829830

830831
/// Check a reference to a local or global.
@@ -868,6 +869,7 @@ void swift::checkActorIsolation(const Expr *expr, const DeclContext *dc) {
868869
case ActorIsolationRestriction::Unsafe:
869870
return diagnoseReferenceToUnsafe(value, loc);
870871
}
872+
llvm_unreachable("unhandled actor isolation kind!");
871873
}
872874

873875
/// Check a reference with the given base expression to the given member.
@@ -964,6 +966,7 @@ void swift::checkActorIsolation(const Expr *expr, const DeclContext *dc) {
964966
case ActorIsolationRestriction::Unsafe:
965967
return diagnoseReferenceToUnsafe(member, memberLoc);
966968
}
969+
llvm_unreachable("unhandled actor isolation kind!");
967970
}
968971
};
969972

lib/Sema/TypeCheckRequestFunctions.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ static Type inferFunctionBuilderType(ValueDecl *decl) {
262262
case DynamicReplacement:
263263
return dynamicReplacement->getName();
264264
}
265+
llvm_unreachable("unhandled decl name kind!");
265266
}
266267
};
267268

0 commit comments

Comments
 (0)