[llvm] 160d46d - [WebAssembly] Fix warnings

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 22 14:48:16 PDT 2025


Author: Kazu Hirata
Date: 2025-07-22T14:48:09-07:00
New Revision: 160d46d4c3f456868c41d56d5819d7ae2a1ba5d5

URL: https://github.com/llvm/llvm-project/commit/160d46d4c3f456868c41d56d5819d7ae2a1ba5d5
DIFF: https://github.com/llvm/llvm-project/commit/160d46d4c3f456868c41d56d5819d7ae2a1ba5d5.diff

LOG: [WebAssembly] Fix warnings

This patch fixes:

  llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp:126:26:
  error: lambda capture 'DAG' is not used
  [-Werror,-Wunused-lambda-capture]

  llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp:239:28:
  error: unused variable 'Info' [-Werror,-Wunused-variable]

Added: 
    

Modified: 
    llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
    llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
index a7991319be8c7..fa5776cddcd29 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
@@ -123,7 +123,7 @@ static SDValue getTagSymNode(int Tag, SelectionDAG *DAG) {
 static APInt encodeFunctionSignature(SelectionDAG *DAG, SDLoc &DL,
                                      SmallVector<MVT, 4> &Returns,
                                      SmallVector<MVT, 4> &Params) {
-  auto toWasmValType = [&DAG, &DL](MVT VT) {
+  auto toWasmValType = [&](MVT VT) {
     if (VT == MVT::i32) {
       return wasm::ValType::I32;
     }

diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
index 4a57669835af9..4613fcb608d64 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
@@ -239,6 +239,7 @@ void WebAssemblyMCInstLower::lower(const MachineInstr *MI,
       const MCOperandInfo &Info = Operands[DescIndex];
       assert(Info.OperandType == WebAssembly::OPERAND_TYPEINDEX &&
              "unexpected CImmediate operand");
+      (void)Info;
       MCOp = lowerEncodedFunctionSignature(MO.getCImm()->getValue());
       break;
     }


        


More information about the llvm-commits mailing list