Skip to content

Commit 4a349f9

Browse files
committed
SIL: Gate checkForLeaksAfterDestruction to asserts builds
1 parent 4988127 commit 4a349f9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SIL/IR/SILModule.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,15 @@ void SILModule::checkForLeaks() const {
167167
}
168168

169169
void SILModule::checkForLeaksAfterDestruction() {
170+
#ifndef NDEBUG
170171
int numAllocated = SILInstruction::getNumCreatedInstructions() -
171172
SILInstruction::getNumDeletedInstructions();
172173

173174
if (numAllocated != 0) {
174175
llvm::errs() << "Leaking " << numAllocated << " instructions!\n";
175176
llvm_unreachable("leaking instructions");
176177
}
178+
#endif
177179
}
178180

179181
std::unique_ptr<SILModule> SILModule::createEmptyModule(

0 commit comments

Comments
 (0)