Skip to content

Commit 0e83389

Browse files
committed
Wrap assertion code in infndef NDEBUG to fix non-asserts build.
1 parent dfbb12a commit 0e83389

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,12 +2558,14 @@ void IRGenDebugInfoImpl::emitVariableDeclaration(
25582558
AlignInBits = SizeOfByte;
25592559

25602560
// Sanity checks.
2561+
#ifndef NDEBUG
25612562
assert(SizeInBits && "zero-sized piece");
25622563
if (getSizeInBits(Var)) {
25632564
assert(SizeInBits < getSizeInBits(Var) && "piece covers entire var");
25642565
assert(OffsetInBits + SizeInBits <= getSizeInBits(Var) &&
25652566
"pars > totum");
25662567
}
2568+
#endif
25672569

25682570
// Add the piece DWARF expression.
25692571
Operands.push_back(llvm::dwarf::DW_OP_LLVM_fragment);

0 commit comments

Comments
 (0)