diff --git a/include/swift/AST/Decl.h b/include/swift/AST/Decl.h index 75776ff3610f8..e8b6870d21025 100644 --- a/include/swift/AST/Decl.h +++ b/include/swift/AST/Decl.h @@ -3762,6 +3762,7 @@ struct SelfReferencePosition final { case Contravariant: return Covariant; } + llvm_unreachable("unhandled self reference position!"); } explicit operator bool() const { return kind > None; } diff --git a/include/swift/AST/ForeignErrorConvention.h b/include/swift/AST/ForeignErrorConvention.h index d09a7a80c0d86..3d9d95280c0e2 100644 --- a/include/swift/AST/ForeignErrorConvention.h +++ b/include/swift/AST/ForeignErrorConvention.h @@ -198,6 +198,7 @@ class ForeignErrorConvention { case NonNilError: return false; } + llvm_unreachable("unhandled foreign error kind!"); } bool operator==(ForeignErrorConvention other) const { diff --git a/include/swift/Demangling/TypeLookupError.h b/include/swift/Demangling/TypeLookupError.h index c67fc35598be8..cf2c75087e0fa 100644 --- a/include/swift/Demangling/TypeLookupError.h +++ b/include/swift/Demangling/TypeLookupError.h @@ -150,6 +150,7 @@ class TypeLookupError { delete castContext; return nullptr; } + llvm_unreachable("unhandled command!"); }; } diff --git a/include/swift/Sema/ConstraintSystem.h b/include/swift/Sema/ConstraintSystem.h index 0642dedac73ba..5dd0778a492ee 100644 --- a/include/swift/Sema/ConstraintSystem.h +++ b/include/swift/Sema/ConstraintSystem.h @@ -1907,6 +1907,7 @@ class SolutionApplicationTarget { case Kind::patternBinding: return patternBinding; } + llvm_unreachable("invalid case label type"); } VarDecl *getAsUninitializedWrappedVar() const { @@ -1921,6 +1922,7 @@ class SolutionApplicationTarget { case Kind::uninitializedWrappedVar: return uninitializedWrappedVar; } + llvm_unreachable("invalid case label type"); } BraceStmt *getFunctionBody() const { diff --git a/lib/AST/AutoDiff.cpp b/lib/AST/AutoDiff.cpp index 492e38a2cb861..566de24dae297 100644 --- a/lib/AST/AutoDiff.cpp +++ b/lib/AST/AutoDiff.cpp @@ -462,6 +462,7 @@ bool swift::operator==(const TangentPropertyInfo::Error &lhs, case TangentPropertyInfo::Error::Kind::TangentPropertyWrongType: return lhs.getType()->isEqual(rhs.getType()); } + llvm_unreachable("unhandled tangent property!"); } void swift::simple_display(llvm::raw_ostream &os, TangentPropertyInfo info) { diff --git a/lib/AST/ClangTypeConverter.cpp b/lib/AST/ClangTypeConverter.cpp index 9fd13f797798d..365d9b72e3d03 100644 --- a/lib/AST/ClangTypeConverter.cpp +++ b/lib/AST/ClangTypeConverter.cpp @@ -207,6 +207,7 @@ const clang::Type *ClangTypeConverter::getFunctionType( case SILFunctionType::Representation::Closure: llvm_unreachable("Expected a C-compatible representation."); } + llvm_unreachable("unhandled representation!"); } clang::QualType ClangTypeConverter::convertMemberType(NominalTypeDecl *DC, diff --git a/lib/AST/TypeCheckRequests.cpp b/lib/AST/TypeCheckRequests.cpp index 707b0cdecb62c..30a5d1c84a02d 100644 --- a/lib/AST/TypeCheckRequests.cpp +++ b/lib/AST/TypeCheckRequests.cpp @@ -1497,6 +1497,7 @@ bool ActorIsolation::requiresSubstitution() const { case GlobalActor: return getGlobalActor()->hasTypeParameter(); } + llvm_unreachable("unhandled actor isolation kind!"); } ActorIsolation ActorIsolation::subst(SubstitutionMap subs) const { @@ -1509,6 +1510,7 @@ ActorIsolation ActorIsolation::subst(SubstitutionMap subs) const { case GlobalActor: return forGlobalActor(getGlobalActor().subst(subs)); } + llvm_unreachable("unhandled actor isolation kind!"); } void swift::simple_display( diff --git a/lib/Driver/DarwinToolChains.cpp b/lib/Driver/DarwinToolChains.cpp index 0f4ffda29b3fb..95accad29f2bd 100644 --- a/lib/Driver/DarwinToolChains.cpp +++ b/lib/Driver/DarwinToolChains.cpp @@ -364,6 +364,7 @@ bool jobMatchesFilter(LinkKind jobKind, BackDeployLibFilter filter) { case BackDeployLibFilter::all: return true; } + llvm_unreachable("unhandled back deploy lib filter!"); } } diff --git a/lib/IDE/APIDigesterData.cpp b/lib/IDE/APIDigesterData.cpp index 5bda079279477..d4d9a6655aba1 100644 --- a/lib/IDE/APIDigesterData.cpp +++ b/lib/IDE/APIDigesterData.cpp @@ -56,6 +56,7 @@ StringRef swift::ide::api::getDeclKindStr(const DeclKind Value, bool lower) { } #include "swift/AST/DeclNodes.def" } + llvm_unreachable("Unhandled DeclKind in switch."); } else { return getDeclKindStrRaw(Value); } diff --git a/lib/IRGen/MetadataLayout.cpp b/lib/IRGen/MetadataLayout.cpp index e93d370240ea4..5ea2eb6ee2be4 100644 --- a/lib/IRGen/MetadataLayout.cpp +++ b/lib/IRGen/MetadataLayout.cpp @@ -414,6 +414,7 @@ ClassMetadataLayout::getMethodInfo(IRGenFunction &IGF, SILDeclRef method) const{ case MethodInfo::Kind::DirectImpl: return MethodInfo(stored.TheImpl); } + llvm_unreachable("unhandled method info kind!"); } Offset ClassMetadataLayout::getFieldOffset(IRGenFunction &IGF, diff --git a/lib/IRGen/MetadataRequest.cpp b/lib/IRGen/MetadataRequest.cpp index d3f9fe58b6a16..34b1b05b042dc 100644 --- a/lib/IRGen/MetadataRequest.cpp +++ b/lib/IRGen/MetadataRequest.cpp @@ -616,6 +616,7 @@ static MetadataResponse emitNominalPrespecializedGenericMetadataRef( return MetadataResponse::handle(IGF, request, call); } } + llvm_unreachable("unhandled metadata canonicality"); } static llvm::Value * diff --git a/lib/SILOptimizer/Differentiation/PullbackCloner.cpp b/lib/SILOptimizer/Differentiation/PullbackCloner.cpp index 29adb43cfca57..38f94d73f8fec 100644 --- a/lib/SILOptimizer/Differentiation/PullbackCloner.cpp +++ b/lib/SILOptimizer/Differentiation/PullbackCloner.cpp @@ -336,6 +336,7 @@ class PullbackCloner::Implementation final case AdjointValueKind::Concrete: return val.getConcreteValue(); } + llvm_unreachable("unhandled adjoint value kind!"); } /// Materializes an adjoint value indirectly to a SIL buffer. diff --git a/lib/SILOptimizer/SemanticARC/OwnershipPhiOperand.h b/lib/SILOptimizer/SemanticARC/OwnershipPhiOperand.h index 169eb9859bea8..88ba1007d2ea2 100644 --- a/lib/SILOptimizer/SemanticARC/OwnershipPhiOperand.h +++ b/lib/SILOptimizer/SemanticARC/OwnershipPhiOperand.h @@ -88,6 +88,7 @@ class LLVM_LIBRARY_VISIBILITY OwnershipPhiOperand { case Kind::Struct: return false; } + llvm_unreachable("unhandled operand kind!"); } bool operator<(const OwnershipPhiOperand &other) const { @@ -113,6 +114,7 @@ class LLVM_LIBRARY_VISIBILITY OwnershipPhiOperand { }); } } + llvm_unreachable("unhandled operand kind!"); } }; diff --git a/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp b/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp index 6483b47a12a6f..fd7695b164640 100644 --- a/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp +++ b/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp @@ -984,6 +984,7 @@ specializeApplySite(SILOptFunctionBuilder &FuncBuilder, ApplySite Apply, GenericSpecializationInformation::create(ApplyInst, Builder)); } } + llvm_unreachable("unhandled apply inst kind!"); } static void rewriteApplySites(AllocBoxToStackState &pass) { diff --git a/lib/Sema/TypeCheckConcurrency.cpp b/lib/Sema/TypeCheckConcurrency.cpp index 474512979861c..0215c6687e89d 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -825,6 +825,7 @@ void swift::checkActorIsolation(const Expr *expr, const DeclContext *dc) { // Okay. return false; } + llvm_unreachable("unhandled actor isolation kind!"); } /// Check a reference to a local or global. @@ -868,6 +869,7 @@ void swift::checkActorIsolation(const Expr *expr, const DeclContext *dc) { case ActorIsolationRestriction::Unsafe: return diagnoseReferenceToUnsafe(value, loc); } + llvm_unreachable("unhandled actor isolation kind!"); } /// 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) { case ActorIsolationRestriction::Unsafe: return diagnoseReferenceToUnsafe(member, memberLoc); } + llvm_unreachable("unhandled actor isolation kind!"); } }; diff --git a/lib/Sema/TypeCheckRequestFunctions.cpp b/lib/Sema/TypeCheckRequestFunctions.cpp index c3abd1a067820..78d4c0c231f2d 100644 --- a/lib/Sema/TypeCheckRequestFunctions.cpp +++ b/lib/Sema/TypeCheckRequestFunctions.cpp @@ -262,6 +262,7 @@ static Type inferFunctionBuilderType(ValueDecl *decl) { case DynamicReplacement: return dynamicReplacement->getName(); } + llvm_unreachable("unhandled decl name kind!"); } };