[llvm] e550dfa - Silence a few unused variable warnings. NFC.

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 01:16:05 PST 2022


Author: Sjoerd Meijer
Date: 2022-01-05T09:15:07Z
New Revision: e550dfa4a6e65e8b3b50dc126c9ab12f70cb0637

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

LOG: Silence a few unused variable warnings. NFC.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/Attributor.cpp
    llvm/lib/Transforms/Utils/LCSSA.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 94515b60f1dd7..4b10e52d49fb4 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -753,6 +753,7 @@ void IRPosition::verify() {
     assert((CBContext == nullptr) &&
            "'call site argument' position must not have CallBaseContext!");
     Use *U = getAsUsePtr();
+    (void)U; // Silence unused variable warning.
     assert(U && "Expected use for a 'call site argument' position!");
     assert(isa<CallBase>(U->getUser()) &&
            "Expected call base user for a 'call site argument' position!");

diff  --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp
index 668626fef933b..72b864dc3e484 100644
--- a/llvm/lib/Transforms/Utils/LCSSA.cpp
+++ b/llvm/lib/Transforms/Utils/LCSSA.cpp
@@ -339,8 +339,10 @@ bool llvm::formLCSSA(Loop &L, const DominatorTree &DT, const LoopInfo *LI,
 
 #ifdef EXPENSIVE_CHECKS
   // Verify all sub-loops are in LCSSA form already.
-  for (Loop *SubLoop: L)
+  for (Loop *SubLoop: L) {
+    (void)SubLoop; // Silence unused variable warning.
     assert(SubLoop->isRecursivelyLCSSAForm(DT, *LI) && "Subloop not in LCSSA!");
+  }
 #endif
 
   SmallVector<BasicBlock *, 8> ExitBlocks;


        


More information about the llvm-commits mailing list