Skip to content

Commit 037f168

Browse files
author
Sasha Krassovsky
committed
Fix warnings in Parse
1 parent c5bfa45 commit 037f168

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

lib/Parse/ParseIfConfig.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static StringRef getPlatformConditionName(PlatformConditionKind Kind) {
5151
case PlatformConditionKind::LABEL: return IDENTIFIER;
5252
#include "swift/AST/PlatformConditionKinds.def"
5353
}
54+
llvm_unreachable("Unhandled PlatformConditionKind in switch");
5455
}
5556

5657
/// Extract source text of the expression.

lib/Parse/ParseRequests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ BraceStmt *ParseAbstractFunctionBodyRequest::evaluate(
8686
return body;
8787
}
8888
}
89-
89+
llvm_unreachable("Unhandled BodyKind in switch");
9090
}
9191

9292

lib/Parse/Scope.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ void ScopeInfo::addToScope(ValueDecl *D, Parser &TheParser,
145145
std::make_pair(CurScope->getDepth(), D));
146146
}
147147

148+
149+
// Disable the "for use only in debugger" warning.
150+
#if SWIFT_COMPILER_IS_MSVC
151+
#pragma warning(push)
152+
#pragma warning(disable : 4996)
153+
#endif
154+
148155
void ScopeInfo::dump() const {
149156
#ifndef NDEBUG
150157
// Dump out the current list of scopes.
@@ -167,3 +174,7 @@ void ScopeInfo::dump() const {
167174
llvm::dbgs() << "\n";
168175
#endif
169176
}
177+
178+
#if SWIFT_COMPILER_IS_MSVC
179+
#pragma warning(pop)
180+
#endif

0 commit comments

Comments
 (0)