Skip to content

Commit fc397de

Browse files
authored
Merge pull request #78776 from compnerd/suppression
lib: simplify some pragma usage
2 parents ce0c057 + 42af060 commit fc397de

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

lib/AST/ASTScope.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,11 @@ CatchNode ASTScope::lookupCatchNode(ModuleDecl *module, SourceLoc loc) {
199199
}
200200

201201
#if SWIFT_COMPILER_IS_MSVC
202-
#pragma warning(push)
203-
#pragma warning(disable : 4996)
202+
#pragma warning(supress: 4996)
204203
#endif
205204

206205
void ASTScope::dump() const { impl->dump(); }
207206

208-
#if SWIFT_COMPILER_IS_MSVC
209-
#pragma warning(pop)
210-
#endif
211-
212207
void ASTScope::print(llvm::raw_ostream &out) const { impl->print(out); }
213208
void ASTScope::dumpOneScopeMapLocation(std::pair<unsigned, unsigned> lineCol) {
214209
impl->dumpOneScopeMapLocation(lineCol);

lib/Sema/Constraint.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,13 +562,9 @@ void Constraint::dump(SourceManager *sm) const {
562562
void Constraint::dump(ConstraintSystem *CS) const {
563563
// Disable MSVC warning: only for use within the debugger.
564564
#if SWIFT_COMPILER_IS_MSVC
565-
#pragma warning(push)
566-
#pragma warning(disable: 4996)
565+
#pragma warning(suppress: 4996)
567566
#endif
568567
dump(&CS->getASTContext().SourceMgr);
569-
#if SWIFT_COMPILER_IS_MSVC
570-
#pragma warning(pop)
571-
#endif
572568
}
573569

574570

0 commit comments

Comments
 (0)