Skip to content

Commit bb6dfc6

Browse files
gottesmmshahmishal
authored andcommitted
[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
1 parent 4c93e64 commit bb6dfc6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,16 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
12141214
}
12151215
}
12161216

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

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

0 commit comments

Comments
 (0)