[llvm] 15ca5a8 - [MC] Remove MCAsmLayout::getFragmentAddress

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 11:10:55 PDT 2024


Author: Fangrui Song
Date: 2024-07-01T11:09:58-07:00
New Revision: 15ca5a8cdb7a4131b891cec73333e9ebb7ed3d04

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

LOG: [MC] Remove MCAsmLayout::getFragmentAddress

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
    llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
index 4b146aea9a8ac..81191c456dc1e 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
@@ -520,7 +520,7 @@ static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
 }
 
 bool RISCVAsmBackend::evaluateTargetFixup(
-    const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFixup &Fixup,
+    const MCAssembler &Asm, const MCFixup &Fixup,
     const MCFragment *DF, const MCValue &Target, const MCSubtargetInfo *STI,
     uint64_t &Value, bool &WasForced) {
   const MCFixup *AUIPCFixup;
@@ -570,7 +570,7 @@ bool RISCVAsmBackend::evaluateTargetFixup(
   if (!IsResolved)
     return false;
 
-  Value = Layout.getSymbolOffset(SA) + AUIPCTarget.getConstant();
+  Value = Asm.getSymbolOffset(SA) + AUIPCTarget.getConstant();
   Value -= Asm.getFragmentOffset(*AUIPCDF) + AUIPCFixup->getOffset();
 
   if (shouldForceRelocation(Asm, *AUIPCFixup, AUIPCTarget, STI)) {

diff  --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h
index 6ce7402d87ca1..3909ec66895e1 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h
@@ -47,7 +47,7 @@ class RISCVAsmBackend : public MCAsmBackend {
   bool shouldInsertFixupForCodeAlign(MCAssembler &Asm,
                                      MCAlignFragment &AF) override;
 
-  bool evaluateTargetFixup(const MCAssembler &Asm, const MCAsmLayout &Layout,
+  bool evaluateTargetFixup(const MCAssembler &Asm,
                            const MCFixup &Fixup, const MCFragment *DF,
                            const MCValue &Target, const MCSubtargetInfo *STI,
                            uint64_t &Value, bool &WasForced) override;


        


More information about the llvm-commits mailing list