Skip to content

Commit 397fdb1

Browse files
Enclose code in nondebug in #ifndef NDEBUG/#endif (#142189)
A previous change to InterpBuiltin.cpp fixed an unused variable warning by using [[maybe unused]] and (void). The code actually serves no useful purpose in non-debug builds, so let's not include it there.
1 parent ff94ba6 commit 397fdb1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,12 +763,12 @@ static bool interp__builtin_ffs(InterpState &S, CodePtr OpPC,
763763
static bool interp__builtin_addressof(InterpState &S, CodePtr OpPC,
764764
const InterpFrame *Frame,
765765
const CallExpr *Call) {
766+
#ifndef NDEBUG
766767
assert(Call->getArg(0)->isLValue());
767-
[[maybe_unused]] PrimType PtrT =
768-
S.getContext().classify(Call->getArg(0)).value_or(PT_Ptr);
768+
PrimType PtrT = S.getContext().classify(Call->getArg(0)).value_or(PT_Ptr);
769769
assert(PtrT == PT_Ptr &&
770770
"Unsupported pointer type passed to __builtin_addressof()");
771-
(void)PtrT;
771+
#endif
772772
return true;
773773
}
774774

0 commit comments

Comments
 (0)