Skip to content

Commit a40e699

Browse files
authored
Merge pull request #29427 from davezarzycki/pr29427
[IRGen] Fully disable an assert that leaves junk in /tmp
2 parents ce76544 + 0fa9a96 commit a40e699

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/IRGen/IRGen.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,11 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
467467
StringRef OutputFilename,
468468
UnifiedStatsReporter *Stats) {
469469
#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
470475
// To check that we only skip generating code when it would have no effect, in
471476
// assertion builds we still generate the code, but write it into a temporary
472477
// file that we compare to the original file.
@@ -499,7 +504,7 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
499504
!Opts.PrintInlineTree &&
500505
!needsRecompile(OutputFilename, HashData, HashGlobal, DiagMutex)) {
501506
// 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
503508
return false;
504509
#else
505510
// ...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,
603608
if (DiagMutex)
604609
DiagMutex->unlock();
605610
}
606-
#if 0
607-
#ifndef NDEBUG
611+
#ifdef DEBUG_VERIFY_GENERATED_CODE
608612
if (!OriginalOutputFilename.empty()) {
609613
// We're done changing the file; make sure it's saved before we compare.
610614
RawOS->close();
@@ -639,7 +643,6 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
639643
llvm_unreachable("one of these should be a temporary file");
640644
}
641645
}
642-
#endif
643646
#endif
644647

645648
return false;

0 commit comments

Comments
 (0)