From bb6dfc63a6329c6101ec72c665c1d335064073ca Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Tue, 18 May 2021 11:21:03 -0700 Subject: [PATCH] [sil][debug-info] Turn off a few asserts just on 5.4 to eliminate some 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 --- lib/SIL/Verifier/SILVerifier.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/SIL/Verifier/SILVerifier.cpp b/lib/SIL/Verifier/SILVerifier.cpp index 001fa349a57cd..6368b880ab429 100644 --- a/lib/SIL/Verifier/SILVerifier.cpp +++ b/lib/SIL/Verifier/SILVerifier.cpp @@ -1214,6 +1214,16 @@ class SILVerifier : public SILVerifierBase { } } +// 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; @@ -1228,6 +1238,7 @@ class SILVerifier : public SILVerifierBase { 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