[llvm] d79e3af - [TableGen] Fix unused-variable warnings in CodeGenSchedule.cpp (NFC)

Jie Fu via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 22:49:55 PST 2025


Author: Jie Fu
Date: 2025-01-18T14:48:55+08:00
New Revision: d79e3af8ad126e352338d4fe4e3b2a13c8d587dc

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

LOG: [TableGen] Fix unused-variable warnings in CodeGenSchedule.cpp (NFC)

/llvm-project/llvm/utils/TableGen/Common/CodeGenSchedule.cpp:1704:32:
 error: unused variable 'Seq' [-Werror,-Wunused-variable]
    SmallVectorImpl<unsigned> &Seq =
                               ^
/llvm-project/llvm/utils/TableGen/Common/CodeGenSchedule.cpp:1713:32:
 error: unused variable 'Seq' [-Werror,-Wunused-variable]
    SmallVectorImpl<unsigned> &Seq =
                               ^
2 errors generated.

Added: 
    

Modified: 
    llvm/utils/TableGen/Common/CodeGenSchedule.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/Common/CodeGenSchedule.cpp b/llvm/utils/TableGen/Common/CodeGenSchedule.cpp
index 60e4363b3c0b93..06ef259c65ccfb 100644
--- a/llvm/utils/TableGen/Common/CodeGenSchedule.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenSchedule.cpp
@@ -1701,7 +1701,7 @@ void CodeGenSchedModels::inferFromRW(ArrayRef<unsigned> OperWrites,
   for (unsigned WriteIdx : OperWrites) {
     IdxVec WriteSeq;
     expandRWSequence(WriteIdx, WriteSeq, /*IsRead=*/false);
-    SmallVectorImpl<unsigned> &Seq =
+    [[maybe_unused]] SmallVectorImpl<unsigned> &Seq =
         LastTransitions[0].WriteSequences.emplace_back(WriteSeq.begin(),
                                                        WriteSeq.end());
     LLVM_DEBUG(dbgs() << "("; dumpIdxVec(Seq); dbgs() << ") ");
@@ -1710,7 +1710,7 @@ void CodeGenSchedModels::inferFromRW(ArrayRef<unsigned> OperWrites,
   for (unsigned ReadIdx : OperReads) {
     IdxVec ReadSeq;
     expandRWSequence(ReadIdx, ReadSeq, /*IsRead=*/true);
-    SmallVectorImpl<unsigned> &Seq =
+    [[maybe_unused]] SmallVectorImpl<unsigned> &Seq =
         LastTransitions[0].ReadSequences.emplace_back(ReadSeq.begin(),
                                                       ReadSeq.end());
     LLVM_DEBUG(dbgs() << "("; dumpIdxVec(Seq); dbgs() << ") ");


        


More information about the llvm-commits mailing list