Skip to content

Commit a578558

Browse files
committed
[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.
1 parent fa478bd commit a578558

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,12 +1246,12 @@ uint64_t ARMAsmBackendDarwin::generateCompactUnwindEncoding(
12461246
}
12471247
int StackAdjust = CFARegisterOffset - 8;
12481248
if (RegOffsets.lookup(ARM::LR) != (-4 - StackAdjust)) {
1249-
DEBUG_WITH_TYPE("compact-unwind",
1250-
llvm::dbgs()
1251-
<< "LR not saved as standard frame, StackAdjust="
1252-
<< StackAdjust
1253-
<< ", CFARegisterOffset=" << CFARegisterOffset
1254-
<< ", lr save at offset=" << RegOffsets[14] << "\n");
1249+
DEBUG_WITH_TYPE(
1250+
"compact-unwind",
1251+
llvm::dbgs() << "LR not saved as standard frame, StackAdjust="
1252+
<< StackAdjust
1253+
<< ", CFARegisterOffset=" << CFARegisterOffset
1254+
<< ", lr save at offset=" << RegOffsets[ARM::LR] << "\n");
12551255
return CU::UNWIND_ARM_MODE_DWARF;
12561256
}
12571257
if (RegOffsets.lookup(ARM::R7) != (-8 - StackAdjust)) {

0 commit comments

Comments
 (0)