Skip to content

[IRGen] Fully disable an assert that leaves junk in /tmp #29427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/IRGen/IRGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,11 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
StringRef OutputFilename,
UnifiedStatsReporter *Stats) {
#ifndef NDEBUG
// FIXME: Some bots are failing. See: rdar://54708850
//#define DEBUG_VERIFY_GENERATED_CODE
#endif

#ifdef DEBUG_VERIFY_GENERATED_CODE
// To check that we only skip generating code when it would have no effect, in
// assertion builds we still generate the code, but write it into a temporary
// file that we compare to the original file.
Expand Down Expand Up @@ -499,7 +504,7 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
!Opts.PrintInlineTree &&
!needsRecompile(OutputFilename, HashData, HashGlobal, DiagMutex)) {
// The llvm IR did not change. We don't need to re-create the object file.
#ifdef NDEBUG
#ifndef DEBUG_VERIFY_GENERATED_CODE
return false;
#else
// ...but we're in an asserts build, so we want to check that assumption.
Expand Down Expand Up @@ -603,8 +608,7 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
if (DiagMutex)
DiagMutex->unlock();
}
#if 0
#ifndef NDEBUG
#ifdef DEBUG_VERIFY_GENERATED_CODE
if (!OriginalOutputFilename.empty()) {
// We're done changing the file; make sure it's saved before we compare.
RawOS->close();
Expand Down Expand Up @@ -639,7 +643,6 @@ bool swift::performLLVM(const IRGenOptions &Opts, DiagnosticEngine *Diags,
llvm_unreachable("one of these should be a temporary file");
}
}
#endif
#endif

return false;
Expand Down