[llvm] bc6d925 - [MC] Simplify isSymbolRefDifferenceFullyResolvedImpl overloads. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 29 16:10:38 PDT 2024
Author: Fangrui Song
Date: 2024-06-29T16:10:33-07:00
New Revision: bc6d925528439b8a8dfefdcaeaab4be2e0904b15
URL: https://github.com/llvm/llvm-project/commit/bc6d925528439b8a8dfefdcaeaab4be2e0904b15
DIFF: https://github.com/llvm/llvm-project/commit/bc6d925528439b8a8dfefdcaeaab4be2e0904b15.diff
LOG: [MC] Simplify isSymbolRefDifferenceFullyResolvedImpl overloads. NFC
The base implementation is simple. Just inline it.
Added:
Modified:
llvm/lib/MC/ELFObjectWriter.cpp
llvm/lib/MC/WinCOFFObjectWriter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 5724c5c785603..72e58d717ce34 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1521,8 +1521,7 @@ bool ELFObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(
SymA.getType() == ELF::STT_GNU_IFUNC)
return false;
}
- return MCObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(Asm, SymA, FB,
- InSet, IsPCRel);
+ return &SymA.getSection() == FB.getParent();
}
std::unique_ptr<MCObjectWriter>
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp
index a58ce90902ed3..a938f433cabc0 100644
--- a/llvm/lib/MC/WinCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp
@@ -1204,8 +1204,7 @@ bool WinCOFFObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(
uint16_t Type = cast<MCSymbolCOFF>(SymA).getType();
if ((Type >> COFF::SCT_COMPLEX_TYPE_SHIFT) == COFF::IMAGE_SYM_DTYPE_FUNCTION)
return false;
- return MCObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(Asm, SymA, FB,
- InSet, IsPCRel);
+ return &SymA.getSection() == FB.getParent();
}
void WinCOFFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
More information about the llvm-commits
mailing list