diff options
author | DeanSturtevant1 <dsturtevant@google.com> | 2025-05-30 16:34:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-30 16:34:55 -0400 |
commit | 397fdb172a515f5cd75aa6bf9ef530ac6eb4dd25 (patch) | |
tree | c48d01023411c9a5d4c106c081e612f53aa5ddf3 /clang/lib/AST/ByteCode/InterpBuiltin.cpp | |
parent | ff94ba613e2fab918d5d96c57833ee3f6e3f3015 (diff) | |
download | llvm-397fdb172a515f5cd75aa6bf9ef530ac6eb4dd25.zip llvm-397fdb172a515f5cd75aa6bf9ef530ac6eb4dd25.tar.gz llvm-397fdb172a515f5cd75aa6bf9ef530ac6eb4dd25.tar.bz2 |
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.
Diffstat (limited to 'clang/lib/AST/ByteCode/InterpBuiltin.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/InterpBuiltin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp index bfad4e7..89c626d 100644 --- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp +++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp @@ -763,12 +763,12 @@ static bool interp__builtin_ffs(InterpState &S, CodePtr OpPC, static bool interp__builtin_addressof(InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const CallExpr *Call) { +#ifndef NDEBUG assert(Call->getArg(0)->isLValue()); - [[maybe_unused]] PrimType PtrT = - S.getContext().classify(Call->getArg(0)).value_or(PT_Ptr); + PrimType PtrT = S.getContext().classify(Call->getArg(0)).value_or(PT_Ptr); assert(PtrT == PT_Ptr && "Unsupported pointer type passed to __builtin_addressof()"); - (void)PtrT; +#endif return true; } |