From 640e3986f91f951f821d8dacac2c2465371432e3 Mon Sep 17 00:00:00 2001 From: Nate Chandler Date: Thu, 25 Apr 2024 18:02:17 -0700 Subject: [PATCH] [SIL] Only verify ownership when not disabled. The option -disable-sil-ownership-verifier should almost never be used. But if it is, it should result in ownership verification being disabled, even when done via direct calls to `SILFunction::verifyOwnership`. There are still a couple of test cases that use -disable-sil-ownership-verifier. --- lib/SIL/Verifier/SILOwnershipVerifier.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/SIL/Verifier/SILOwnershipVerifier.cpp b/lib/SIL/Verifier/SILOwnershipVerifier.cpp index d3f56b34f32c3..1bc54503a27ae 100644 --- a/lib/SIL/Verifier/SILOwnershipVerifier.cpp +++ b/lib/SIL/Verifier/SILOwnershipVerifier.cpp @@ -914,6 +914,8 @@ void SILModule::verifyOwnership() const { void SILFunction::verifyOwnership(DeadEndBlocks *deadEndBlocks) const { if (DisableOwnershipVerification) return; + if (!getModule().getOptions().VerifySILOwnership) + return; #ifdef NDEBUG // When compiling without asserts enabled, only verify ownership if