Skip to content

Commit

Permalink
[sil][debug-info] Turn off a few asserts just on 5.4 to eliminate som…
Browse files Browse the repository at this point in the history
…e crashes in user code.

These asserts validate some behavior of the compiler around which
SILInstruction can be paired with what type of SILLocation. That being said,
these asserts only effect debug info and are tripping in some programs on Linux
where we ship the compiler with assertions enabled. Darwin does not have these
issues since the compiler is shipped /without/ compiler assertions enabled.

rdar://77325585
  • Loading branch information
gottesmm authored and shahmishal committed May 20, 2021
1 parent 4c93e64 commit bb6dfc6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/SIL/Verifier/SILVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,16 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
}
}

// Disable these checks just on 5.4 when compiler asserts are enabled.
//
// These just verify some things about debug info that shouldn't stop a program
// from not-compiling. When optimizing in certain cases, we found that we were
// hitting these on linux platforms since on linux platforms, we ship the
// compiler with assertions enabled. So by disabling this we can at least at
// the expense of slightly worse debug info when compiling with optimization
// eliminate these crashes. Darwin does not ship with compiler-asserts so is
// unaffected.
#if 0
// Regular locations are allowed on all instructions.
if (LocKind == SILLocation::RegularKind)
return;
Expand All @@ -1228,6 +1238,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
if (LocKind == SILLocation::ArtificialUnreachableKind)
require(InstKind == SILInstructionKind::UnreachableInst,
"artificial locations are only allowed on Unreachable instructions");
#endif
}

/// Check that the types of this value producer are all legal in the function
Expand Down

0 comments on commit bb6dfc6

Please sign in to comment.