Skip to content

Commit b2ba590

Browse files
authored
Merge pull request #78102 from meg-gupta/turnonverify
Turn on ownership verification in no-asserts build
2 parents bfae734 + c5a19b9 commit b2ba590

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

lib/SIL/Verifier/SILOwnershipVerifier.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -910,19 +910,6 @@ void SILValue::verifyOwnership(DeadEndBlocks *deadEndBlocks) const {
910910
if (isa<SILUndef>(*this))
911911
return;
912912

913-
#ifdef NDEBUG
914-
// When compiling without asserts enabled, only verify ownership if
915-
// -sil-verify-all is set.
916-
//
917-
// NOTE: We purposely return if we do can not look up a module here to ensure
918-
// that if we run into something that we do not understand, we do not assert
919-
// in user code even though we aren't going to actually verify (the default
920-
// behavior when -sil-verify-all is disabled).
921-
auto *mod = Value->getModule();
922-
if (!mod || !mod->getOptions().VerifyAll)
923-
return;
924-
#endif
925-
926913
// Make sure that we are not a value of an instruction in a SILGlobalVariable
927914
// block.
928915
if (auto *definingInst = getDefiningInstruction()) {
@@ -955,13 +942,6 @@ void SILModule::verifyOwnership() const {
955942
if (DisableOwnershipVerification)
956943
return;
957944

958-
#ifdef NDEBUG
959-
// When compiling without asserts enabled, only verify ownership if
960-
// -sil-verify-all is set.
961-
if (!getOptions().VerifyAll)
962-
return;
963-
#endif
964-
965945
for (const SILFunction &function : *this) {
966946
std::unique_ptr<DeadEndBlocks> deBlocks;
967947
if (!getOptions().OSSAVerifyComplete) {
@@ -978,19 +958,6 @@ void SILFunction::verifyOwnership(DeadEndBlocks *deadEndBlocks) const {
978958
if (!getModule().getOptions().VerifySILOwnership)
979959
return;
980960

981-
#ifdef NDEBUG
982-
// When compiling without asserts enabled, only verify ownership if
983-
// -sil-verify-all is set.
984-
//
985-
// NOTE: We purposely return if we do can not look up a module here to ensure
986-
// that if we run into something that we do not understand, we do not assert
987-
// in user code even though we aren't going to actually verify (the default
988-
// behavior when -sil-verify-all is disabled).
989-
auto *mod = &getModule();
990-
if (!mod || !mod->getOptions().VerifyAll)
991-
return;
992-
#endif
993-
994961
// If the given function has unqualified ownership or we have been asked by
995962
// the user not to verify this function, there is nothing to verify.
996963
if (!hasOwnership() || !shouldVerifyOwnership())

0 commit comments

Comments
 (0)