[llvm] 932c524 - [CodeGen] Fix warning after #115531

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 21:12:12 PST 2024


Author: Fangrui Song
Date: 2024-12-03T21:12:06-08:00
New Revision: 932c5249ff6b3f31f3b67d944cf5ead156b5dd2c

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

LOG: [CodeGen] Fix warning after #115531

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineOperand.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp
index 18027b2db2947c..3a9bdde28a2e71 100644
--- a/llvm/lib/CodeGen/MachineOperand.cpp
+++ b/llvm/lib/CodeGen/MachineOperand.cpp
@@ -909,8 +909,8 @@ void MachineOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
     OS << printJumpTableEntryReference(getIndex());
     break;
   case MachineOperand::MO_GlobalAddress:
-    if (const auto *GV = getGlobal())
-      getGlobal()->printAsOperand(OS, /*PrintType=*/false, MST);
+    if (auto *GV = getGlobal())
+      GV->printAsOperand(OS, /*PrintType=*/false, MST);
     else // Invalid, but may appear in debugging scenarios.
       OS << "globaladdress(null)";
 


        


More information about the llvm-commits mailing list