@@ -316,9 +316,9 @@ static StringRef extractExprText(const Expr *E, SourceManager &SM) {
316
316
// / Returns true when the call expression is a call to swap() in the Standard
317
317
// / Library.
318
318
// / This is a helper function that is only used in an assertion, which is why
319
- // / it is in a namespace rather than 'static' .
320
- namespace {
321
- bool isCallToStandardLibrarySwap (CallExpr *CE, ASTContext &Ctx) {
319
+ // / it is in the ifndef .
320
+ # ifndef NDEBUG
321
+ static bool isCallToStandardLibrarySwap (CallExpr *CE, ASTContext &Ctx) {
322
322
if (CE->getCalledValue () == Ctx.getSwap (nullptr ))
323
323
return true ;
324
324
@@ -331,7 +331,7 @@ bool isCallToStandardLibrarySwap(CallExpr *CE, ASTContext &Ctx) {
331
331
332
332
return false ;
333
333
}
334
- } // end anonymous namespace
334
+ # endif
335
335
336
336
// / Do a sytactic pattern match to try to safely suggest a Fix-It to rewrite
337
337
// / calls like swap(&collection[index1], &collection[index2]) to
@@ -611,7 +611,7 @@ static AccessedStorage findAccessedStorage(SILValue Source) {
611
611
// / Returns true when the apply calls the Standard Library swap().
612
612
// / Used for fix-its to suggest replacing with Collection.swapAt()
613
613
// / on exclusivity violations.
614
- bool isCallToStandardLibrarySwap (ApplyInst *AI, ASTContext &Ctx) {
614
+ static bool isCallToStandardLibrarySwap (ApplyInst *AI, ASTContext &Ctx) {
615
615
SILFunction *SF = AI->getReferencedFunction ();
616
616
if (!SF)
617
617
return false ;
0 commit comments