[llvm] c79827c - [SandboxIR] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 12:05:28 PDT 2024


Author: Kazu Hirata
Date: 2024-10-29T12:05:18-07:00
New Revision: c79827cd15ad31b77702e63e5050c1a8b0b44825

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

LOG: [SandboxIR] Fix a warning

This patch fixes:

  llvm/lib/SandboxIR/Context.cpp:684:22: error: unused variable
  'MaxRegisteredCallbacks' [-Werror,-Wunused-const-variable]

Added: 
    

Modified: 
    llvm/lib/SandboxIR/Context.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/SandboxIR/Context.cpp b/llvm/lib/SandboxIR/Context.cpp
index 5e5cbbbc4515d2..b86ed5864c1ac1 100644
--- a/llvm/lib/SandboxIR/Context.cpp
+++ b/llvm/lib/SandboxIR/Context.cpp
@@ -681,7 +681,7 @@ void Context::runMoveInstrCallbacks(Instruction *I, const BBIterator &WhereIt) {
 // An arbitrary limit, to check for accidental misuse. We expect a small number
 // of callbacks to be registered at a time, but we can increase this number if
 // we discover we needed more.
-static constexpr int MaxRegisteredCallbacks = 16;
+[[maybe_unused]] static constexpr int MaxRegisteredCallbacks = 16;
 
 Context::CallbackID Context::registerEraseInstrCallback(EraseInstrCallback CB) {
   assert(EraseInstrCallbacks.size() <= MaxRegisteredCallbacks &&


        


More information about the llvm-commits mailing list