Skip to content

Commit a17573a

Browse files
authored
Merge pull request swiftlang#27152 from save-buffer/fix_warnings
Fix warnings
2 parents b8fb2e5 + edc26bb commit a17573a

23 files changed

+51
-1
lines changed

include/swift/AST/PropertyWrappers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ struct PropertyWrapperMutability {
109109
}
110110
return std::max(Getter, Setter);
111111
}
112+
llvm_unreachable("Unhandled Value in switch");
112113
}
113114

114115
bool operator==(PropertyWrapperMutability other) const {

include/swift/AST/Requirement.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class Requirement {
167167
case RequirementKind::Layout:
168168
return lhs.getLayoutConstraint() == rhs.getLayoutConstraint();
169169
}
170+
llvm_unreachable("Unhandled RequirementKind in switch");
170171
}
171172
};
172173

include/swift/AST/ResilienceExpansion.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
5454
case ResilienceExpansion::Maximal:
5555
return os << "Maximal";
5656
}
57+
llvm_unreachable("Unhandled ResilienceExpansion in switch");
5758
}
5859

5960
} // namespace swift

include/swift/SIL/AbstractionPattern.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ class AbstractionPattern {
402402
case Kind::Tuple:
403403
return false;
404404
}
405+
llvm_unreachable("Unhandled AbstractionPatternKind in switch");
405406
}
406407

407408
CanGenericSignature getGenericSignature() const {

lib/AST/ASTContext.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4477,6 +4477,7 @@ bool ASTContext::overrideGenericSignatureReqsSatisfied(
44774477
case OverrideGenericSignatureReqCheck::DerivedReqSatisfiedByBase:
44784478
return derivedSig->requirementsNotSatisfiedBy(sig).empty();
44794479
}
4480+
llvm_unreachable("Unhandled OverrideGenericSignatureReqCheck in switch");
44804481
}
44814482

44824483
SILLayout *SILLayout::get(ASTContext &C,

lib/AST/ASTScope.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,17 @@ Optional<bool> ASTScope::computeIsCascadingUse(
5353
return ASTScopeImpl::computeIsCascadingUse(history, initialIsCascadingUse);
5454
}
5555

56+
#if SWIFT_COMPILER_IS_MSVC
57+
#pragma warning(push)
58+
#pragma warning(disable : 4996)
59+
#endif
60+
5661
void ASTScope::dump() const { impl->dump(); }
62+
63+
#if SWIFT_COMPILER_IS_MSVC
64+
#pragma warning(pop)
65+
#endif
66+
5767
void ASTScope::print(llvm::raw_ostream &out) const { impl->print(out); }
5868
void ASTScope::dumpOneScopeMapLocation(std::pair<unsigned, unsigned> lineCol) {
5969
impl->dumpOneScopeMapLocation(lineCol);

lib/AST/ASTScopeCreation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,7 @@ ConditionalClauseScope::expandAScopeThatCreatesANewInsertionPoint(
11781178
return {ccPatternUseScope,
11791179
"Succeeding code must be in scope of conditional variables"};
11801180
}
1181+
llvm_unreachable("Unhandled StmtConditionKind in switch");
11811182
}
11821183

11831184
AnnotatedInsertionPoint

lib/AST/Decl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7660,6 +7660,7 @@ ParseAbstractFunctionBodyRequest::getCachedResult() const {
76607660
case BodyKind::Unparsed:
76617661
return None;
76627662
}
7663+
llvm_unreachable("Unhandled BodyKing in switch");
76637664
}
76647665

76657666
void ParseAbstractFunctionBodyRequest::cacheResult(BraceStmt *value) const {

lib/AST/DeclContext.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ SourceLoc swift::extractNearestSourceLoc(const DeclContext *dc) {
10371037
case DeclContextKind::SerializedLocal:
10381038
return extractNearestSourceLoc(dc->getParent());
10391039
}
1040+
llvm_unreachable("Unhandled DeclCopntextKindin switch");
10401041
}
10411042

10421043
#define DECL(Id, Parent) \

lib/AST/GenericSignature.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,4 +1091,5 @@ Requirement Requirement::getCanonical() const {
10911091
case RequirementKind::Layout:
10921092
return Requirement(getKind(), firstType, getLayoutConstraint());
10931093
}
1094+
llvm_unreachable("Unhandled RequirementKind in switch");
10941095
}

0 commit comments

Comments
 (0)