[llvm] 4f9ea25 - [AsmPrinter] Don't store Dwarf register in Register.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 19:39:34 PDT 2024


Author: Craig Topper
Date: 2024-08-30T19:39:09-07:00
New Revision: 4f9ea258c4f36e01e3a71a3603c588ee52b54a6f

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

LOG: [AsmPrinter] Don't store Dwarf register in Register.

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index c1e8355353cfdc..0a1ff189bedbc4 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -347,8 +347,9 @@ void DwarfCompileUnit::addLocationAttribute(
                 Asm->getObjFileLowering().getIndirectSymViaRWPI(Sym));
         // Base register
         Register BaseReg = Asm->getObjFileLowering().getStaticBase();
-        BaseReg = Asm->TM.getMCRegisterInfo()->getDwarfRegNum(BaseReg, false);
-        addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_breg0 + BaseReg);
+        unsigned DwarfBaseReg =
+            Asm->TM.getMCRegisterInfo()->getDwarfRegNum(BaseReg, false);
+        addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_breg0 + DwarfBaseReg);
         // Offset from base register
         addSInt(*Loc, dwarf::DW_FORM_sdata, 0);
         // Operation


        


More information about the llvm-commits mailing list