[llvm] 9331b5b - [DAG] Fix -Wunused-variable

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 10:51:50 PDT 2026


Author: Aiden Grossman
Date: 2026-03-30T17:51:42Z
New Revision: 9331b5bb7731d6e3b8c041068848150958776f93

URL: https://github.com/llvm/llvm-project/commit/9331b5bb7731d6e3b8c041068848150958776f93
DIFF: https://github.com/llvm/llvm-project/commit/9331b5bb7731d6e3b8c041068848150958776f93.diff

LOG: [DAG] Fix -Wunused-variable

A recently introduced local is only used in an assertion which means we
get -Wunused-variable in release+noasserts builds. Mark it
[[maybe_unused]] rather than inlinine the definition given there are
multiple uses within the assert.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 9094e8341627a..dd810a07c9aa8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -6076,7 +6076,7 @@ KnownFPClass SelectionDAG::computeKnownFPClass(SDValue Op,
   if (Op.getOpcode() == ISD::UNDEF)
     return Known;
 
-  EVT VT = Op.getValueType();
+  [[maybe_unused]] EVT VT = Op.getValueType();
   assert((!VT.isFixedLengthVector() ||
           DemandedElts.getBitWidth() == VT.getVectorNumElements()) &&
          "Unexpected vector size");


        


More information about the llvm-commits mailing list