[llvm] f719a33 - Mark assert-used-only variable as [[maybe_unused]]

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 11:08:07 PDT 2024


Author: David Blaikie
Date: 2024-07-24T18:08:02Z
New Revision: f719a339a89bd64900217dd06075e618ed587be9

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

LOG: Mark assert-used-only variable as [[maybe_unused]]

Seemed nicer than inlining, given the complexities of flag checking and
the multiple uses.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/Core.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
index 6db8e982894bc..a078bffa86f59 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -933,7 +933,8 @@ Error JITDylib::resolve(MaterializationResponsibility &MR,
             SymbolsInErrorState.insert(KV.first);
           else {
             if (SymI->second.getFlags() & JITSymbolFlags::Common) {
-              auto WeakOrCommon = JITSymbolFlags::Weak | JITSymbolFlags::Common;
+              [[maybe_unused]] auto WeakOrCommon =
+                  JITSymbolFlags::Weak | JITSymbolFlags::Common;
               assert((KV.second.getFlags() & WeakOrCommon) &&
                      "Common symbols must be resolved as common or weak");
               assert((KV.second.getFlags() & ~WeakOrCommon) ==


        


More information about the llvm-commits mailing list