[llvm] e4114f9 - [AttributorAttributes] Remove unused variable [NFC]

Mikael Holmen via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 02:08:35 PDT 2023


Author: Mikael Holmen
Date: 2023-09-29T10:50:53+02:00
New Revision: e4114f9c0d2688296993e5d5741b41a20825a6bd

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

LOG: [AttributorAttributes] Remove unused variable [NFC]

gcc warned about it:
 [232/4788] Building CXX object lib/Transforms/IPO/CMakeFiles/LLVMipo.dir/AttributorAttributes.cpp.o
 ../lib/Transforms/IPO/AttributorAttributes.cpp: In lambda function:
 ../lib/Transforms/IPO/AttributorAttributes.cpp:12555:17: warning: unused variable 'SI' [-Wunused-variable]
 12555 |       if (auto *SI = dyn_cast<StoreInst>(Inst)) {
       |                 ^~

Fix the warning by removing the variable and turn dyn_cast into isa.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 03b5dc3899ac8f8..98a989591f1c634 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -12552,7 +12552,7 @@ struct AAAddressSpaceImpl : public AAAddressSpace {
         return true;
       if (isa<LoadInst>(Inst))
         MakeChange(Inst, const_cast<Use &>(U));
-      if (auto *SI = dyn_cast<StoreInst>(Inst)) {
+      if (isa<StoreInst>(Inst)) {
         // We only make changes if the use is the pointer operand.
         if (U.getOperandNo() == 1)
           MakeChange(Inst, const_cast<Use &>(U));


        


More information about the llvm-commits mailing list