[llvm] a578558 - [ARM] Replace a hardcoded 14 used as an MCRegister index with ARM::LR.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 14 12:15:33 PDT 2024


Author: Craig Topper
Date: 2024-09-14T12:14:19-07:00
New Revision: a578558251450dd5ea0efd40825a87c787e522b8

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

LOG: [ARM] Replace a hardcoded 14 used as an MCRegister index with ARM::LR.

LR is R14, but this data structure is indexed by MCRegister not
encoding. It's in a debug message so I guess no one ever noticed.

Found while auditing places that should use MCRegister.

Added: 
    

Modified: 
    llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
index c8ecb4ad5a0e17..cbbe771d7f23e5 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
@@ -1246,12 +1246,12 @@ uint64_t ARMAsmBackendDarwin::generateCompactUnwindEncoding(
   }
   int StackAdjust = CFARegisterOffset - 8;
   if (RegOffsets.lookup(ARM::LR) != (-4 - StackAdjust)) {
-    DEBUG_WITH_TYPE("compact-unwind",
-                    llvm::dbgs()
-                        << "LR not saved as standard frame, StackAdjust="
-                        << StackAdjust
-                        << ", CFARegisterOffset=" << CFARegisterOffset
-                        << ", lr save at offset=" << RegOffsets[14] << "\n");
+    DEBUG_WITH_TYPE(
+        "compact-unwind",
+        llvm::dbgs() << "LR not saved as standard frame, StackAdjust="
+                     << StackAdjust
+                     << ", CFARegisterOffset=" << CFARegisterOffset
+                     << ", lr save at offset=" << RegOffsets[ARM::LR] << "\n");
     return CU::UNWIND_ARM_MODE_DWARF;
   }
   if (RegOffsets.lookup(ARM::R7) != (-8 - StackAdjust)) {


        


More information about the llvm-commits mailing list