Skip to content

FIx recently introduced MSVC control path warnings #6808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2646,6 +2646,8 @@ static inline bool isRawPointerKind(PointerTypeKind PTK) {
case PTK_AutoreleasingUnsafeMutablePointer:
return false;
}

llvm_unreachable("Unhandled PointerTypeKind in switch.");
}

/// NominalTypeDecl - a declaration of a nominal type, like a struct.
Expand Down
2 changes: 2 additions & 0 deletions lib/AST/LayoutConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ StringRef LayoutConstraintInfo::getName(LayoutConstraintKind Kind) {
case LayoutConstraintKind::TrivialOfExactSize:
return "_Trivial";
}

llvm_unreachable("Unhandled LayoutConstraintKind in switch.");
}

SourceRange LayoutConstraintLoc::getSourceRange() const { return getLoc(); }
Expand Down
2 changes: 2 additions & 0 deletions lib/Basic/Demangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,8 @@ NodePointer Demangler::demangleGenericRequirement() {
return LayoutRequirement;
}
}

llvm_unreachable("Unhandled TypeKind in switch.");
}

NodePointer Demangler::demangleGenericType() {
Expand Down
6 changes: 6 additions & 0 deletions lib/SIL/SILOwnershipVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ OwnershipUseCheckerResult OwnershipCompatibilityUseChecker::visitCallee(
case ParameterConvention::Direct_Guaranteed:
return {compatibleWithOwnership(ValueOwnershipKind::Guaranteed), false};
}

llvm_unreachable("Unhandled ParameterConvention in switch.");
}

OwnershipUseCheckerResult
Expand All @@ -468,6 +470,8 @@ OwnershipCompatibilityUseChecker::visitApplyInst(ApplyInst *I) {
case SILArgumentConvention::Direct_Deallocating:
llvm_unreachable("No ownership associated with deallocating");
}

llvm_unreachable("Unhandled SILArgumentConvention in switch.");
}

OwnershipUseCheckerResult
Expand All @@ -494,6 +498,8 @@ OwnershipCompatibilityUseChecker::visitTryApplyInst(TryApplyInst *I) {
case SILArgumentConvention::Direct_Deallocating:
llvm_unreachable("No ownership associated with deallocating");
}

llvm_unreachable("Unhandled SILArgumentConvention in switch.");
}

OwnershipUseCheckerResult
Expand Down
2 changes: 2 additions & 0 deletions lib/SIL/SILType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,4 +601,6 @@ ValueOwnershipKind SILResultInfo::getOwnershipKind(SILModule &M) const {
return ValueOwnershipKind::Trivial;
return ValueOwnershipKind::Unowned;
}

llvm_unreachable("Unhandled ResultConvention in switch.");
}
6 changes: 6 additions & 0 deletions lib/SIL/SILValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ llvm::raw_ostream &swift::operator<<(llvm::raw_ostream &os,
case ValueOwnershipKind::Any:
return os << "Any";
}

llvm_unreachable("Unhandled ValueOwnershipKind in switch.");
}

Optional<ValueOwnershipKind>
Expand Down Expand Up @@ -433,6 +435,8 @@ ValueOwnershipKindVisitor::visitSILFunctionArgument(SILFunctionArgument *Arg) {
case SILArgumentConvention::Direct_Deallocating:
llvm_unreachable("No ownership associated with deallocating");
}

llvm_unreachable("Unhandled SILArgumentConvention in switch.");
}

// This is a forwarding instruction through only one of its arguments.
Expand Down Expand Up @@ -486,6 +490,8 @@ ValueOwnershipKindVisitor::visitLoadInst(LoadInst *LI) {
case LoadOwnershipQualifier::Trivial:
return ValueOwnershipKind::Trivial;
}

llvm_unreachable("Unhandled LoadOwnershipQualifier in switch.");
}

ValueOwnershipKind SILValue::getOwnershipKind() const {
Expand Down
2 changes: 2 additions & 0 deletions lib/Sema/CSApply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6409,6 +6409,8 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
case DeclTypeCheckingSemantics::Normal:
return nullptr;
}

llvm_unreachable("Unhandled DeclTypeCheckingSemantics in switch.");
};

// The function is always an rvalue.
Expand Down
2 changes: 2 additions & 0 deletions lib/Sema/ConstraintSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,8 @@ resolveOverloadForDeclWithSpecialTypeCheckingSemantics(ConstraintSystem &CS,
return true;
}
}

llvm_unreachable("Unhandled DeclTypeCheckingSemantics in switch.");
}

void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
Expand Down
2 changes: 2 additions & 0 deletions lib/Sema/TypeCheckStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,8 @@ static void diagnoseIgnoredLiteral(TypeChecker &TC, LiteralExpr *LE) {
#include "swift/AST/ExprNodes.def"
llvm_unreachable("Not a literal expression");
}

llvm_unreachable("Unhandled ExprKind in switch.");
};

TC.diagnose(LE->getLoc(), diag::expression_unused_literal,
Expand Down