@@ -467,6 +467,11 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
467
467
StringRef OutputFilename,
468
468
UnifiedStatsReporter *Stats) {
469
469
#ifndef NDEBUG
470
+ // FIXME: Some bots are failing. See: rdar://54708850
471
+ // #define DEBUG_VERIFY_GENERATED_CODE
472
+ #endif
473
+
474
+ #ifdef DEBUG_VERIFY_GENERATED_CODE
470
475
// To check that we only skip generating code when it would have no effect, in
471
476
// assertion builds we still generate the code, but write it into a temporary
472
477
// file that we compare to the original file.
@@ -499,7 +504,7 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
499
504
!Opts.PrintInlineTree &&
500
505
!needsRecompile (OutputFilename, HashData, HashGlobal, DiagMutex)) {
501
506
// The llvm IR did not change. We don't need to re-create the object file.
502
- #ifdef NDEBUG
507
+ #ifndef DEBUG_VERIFY_GENERATED_CODE
503
508
return false ;
504
509
#else
505
510
// ...but we're in an asserts build, so we want to check that assumption.
@@ -603,8 +608,7 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
603
608
if (DiagMutex)
604
609
DiagMutex->unlock ();
605
610
}
606
- #if 0
607
- #ifndef NDEBUG
611
+ #ifdef DEBUG_VERIFY_GENERATED_CODE
608
612
if (!OriginalOutputFilename.empty ()) {
609
613
// We're done changing the file; make sure it's saved before we compare.
610
614
RawOS->close ();
@@ -639,7 +643,6 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
639
643
llvm_unreachable (" one of these should be a temporary file" );
640
644
}
641
645
}
642
- #endif
643
646
#endif
644
647
645
648
return false ;
0 commit comments