[llvm] 94aa4bf - [NVPTX] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 17 14:38:26 PDT 2025


Author: Kazu Hirata
Date: 2025-04-17T14:38:21-07:00
New Revision: 94aa4bfba57cd5df5489ceca5c1b4b59cfcc1288

URL: https://github.com/llvm/llvm-project/commit/94aa4bfba57cd5df5489ceca5c1b4b59cfcc1288
DIFF: https://github.com/llvm/llvm-project/commit/94aa4bfba57cd5df5489ceca5c1b4b59cfcc1288.diff

LOG: [NVPTX] Fix a warning

This patch fixes:

  llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h:128:21: error: unused
  variable '_' [-Werror,-Wunused-variable]

Added: 
    

Modified: 
    llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
index 9ed7e650e7b0c..aa953f4596bbd 100644
--- a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
+++ b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
@@ -125,8 +125,10 @@ class LLVM_LIBRARY_VISIBILITY NVPTXAsmPrinter : public AsmPrinter {
     }
 
     void addZeros(unsigned Num) {
-      for (unsigned _ : llvm::seq(Num))
+      for (unsigned _ : llvm::seq(Num)) {
+        (void)_;
         addByte(0);
+      }
     }
 
     void addSymbol(const Value *GVar, const Value *GVarBeforeStripping) {


        


More information about the llvm-commits mailing list