[llvm] d97b2b3 - [DebugInfo] Fix -Wunused-variable in DebugProgramInstruction.cpp (NFC)
Jie Fu via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 2 06:15:50 PDT 2023
Author: Jie Fu
Date: 2023-11-02T21:14:48+08:00
New Revision: d97b2b389a0e511c65af6845119eb08b8a2cb473
URL: https://github.com/llvm/llvm-project/commit/d97b2b389a0e511c65af6845119eb08b8a2cb473
DIFF: https://github.com/llvm/llvm-project/commit/d97b2b389a0e511c65af6845119eb08b8a2cb473.diff
LOG: [DebugInfo] Fix -Wunused-variable in DebugProgramInstruction.cpp (NFC)
/llvm-project/llvm/lib/IR/DebugProgramInstruction.cpp:163:18: error: unused variable 'Unit' [-Werror,-Wunused-variable]
DICompileUnit *Unit =
^
1 error generated.
Added:
Modified:
llvm/lib/IR/DebugProgramInstruction.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/DebugProgramInstruction.cpp b/llvm/lib/IR/DebugProgramInstruction.cpp
index 086e2f70abb33a6..3f39bae983253d0 100644
--- a/llvm/lib/IR/DebugProgramInstruction.cpp
+++ b/llvm/lib/IR/DebugProgramInstruction.cpp
@@ -160,7 +160,7 @@ DPValue *DPValue::clone() const { return new DPValue(*this); }
DbgVariableIntrinsic *
DPValue::createDebugIntrinsic(Module *M, Instruction *InsertBefore) const {
- DICompileUnit *Unit =
+ [[maybe_unused]] DICompileUnit *Unit =
getDebugLoc().get()->getScope()->getSubprogram()->getUnit();
assert(M && Unit &&
"Cannot clone from BasicBlock that is not part of a Module or "
More information about the llvm-commits
mailing list