-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Enclose code in nondebug in #ifndef NDEBUG/#endif #142189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…endif in InterpBuiltin.cpp
@llvm/pr-subscribers-clang Author: None (DeanSturtevant1) ChangesA previous change to InterpBuiltin.cpp fixed an unused variable warning by using [[maybe unused]] and (void). Full diff: https://github.com/llvm/llvm-project/pull/142189.diff 1 Files Affected:
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index bfad4e763692f..55e0061702874 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -763,12 +763,13 @@ 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 =
+ 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;
}
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/6398 Here is the relevant piece of the build log for the reference
|
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.