-
Notifications
You must be signed in to change notification settings - Fork 14.3k
suppresses unused variable warning #99526
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
@llvm/pr-subscribers-debuginfo Author: Christopher Di Bella (cjdb) ChangesFull diff: https://github.com/llvm/llvm-project/pull/99526.diff 1 Files Affected:
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index b9cf36a07846c..3d90c0a2c0de3 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -3362,6 +3362,7 @@ void InstrRefBasedLDV::buildVLocValueMap(
if (BlockLiveIn->Kind == DbgValue::VPHI)
BlockLiveIn->Kind = DbgValue::Def;
auto &[Var, DILoc] = DVMap.lookupDVID(VarID);
+ (void)DILoc;
assert(BlockLiveIn->Properties.DIExpr->getFragmentInfo() ==
Var.getFragment() &&
"Fragment info missing during value prop");
|
@@ -3361,7 +3361,7 @@ void InstrRefBasedLDV::buildVLocValueMap( | |||
continue; | |||
if (BlockLiveIn->Kind == DbgValue::VPHI) | |||
BlockLiveIn->Kind = DbgValue::Def; | |||
auto &[Var, DILoc] = DVMap.lookupDVID(VarID); | |||
[[maybe_unused]] auto &[Var, DILoc] = DVMap.lookupDVID(VarID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW/next time, I'd consider rolling this into the assert, maybe?
assert(BlockLiveIn->Properties.DIExpr->getFragmentInfo() ==
DVMap.lookupDVID(VarID).first.getFragment() &&
...
(so the optimizer doesn't have to deal with the lookup code in nonasserts builds)
(and/or if the named variable helped with readability/was needed for other reasons, maybe using auto &VarID = ...(VarID).first;
? rather than needing to name an extra fully unused variable (DILoc))
(Thanks for catching this for me!) |
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250781
No description provided.