[llvm] 2c4da3c - [MC] Remove unneeded null getFragment() check. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 20:03:20 PDT 2024
Author: Fangrui Song
Date: 2024-09-20T20:03:15-07:00
New Revision: 2c4da3c44bf66e764642b94335f7d718730055f5
URL: https://github.com/llvm/llvm-project/commit/2c4da3c44bf66e764642b94335f7d718730055f5
DIFF: https://github.com/llvm/llvm-project/commit/2c4da3c44bf66e764642b94335f7d718730055f5.diff
LOG: [MC] Remove unneeded null getFragment() check. NFC
Follow-up to d620ba0344c719da51b6067975439ed84024b1ac.
Added:
Modified:
llvm/lib/MC/MCObjectWriter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MC/MCObjectWriter.cpp b/llvm/lib/MC/MCObjectWriter.cpp
index 818e703514d61e..7183acc3865efe 100644
--- a/llvm/lib/MC/MCObjectWriter.cpp
+++ b/llvm/lib/MC/MCObjectWriter.cpp
@@ -38,11 +38,8 @@ bool MCObjectWriter::isSymbolRefDifferenceFullyResolved(
const MCSymbol &SA = A->getSymbol();
const MCSymbol &SB = B->getSymbol();
assert(!SA.isUndefined() && !SB.isUndefined());
- MCFragment *FB = SB.getFragment();
- if (!FB || !SA.getFragment())
- return false;
-
- return isSymbolRefDifferenceFullyResolvedImpl(Asm, SA, *FB, InSet, /*IsPCRel=*/false);
+ return isSymbolRefDifferenceFullyResolvedImpl(Asm, SA, *SB.getFragment(),
+ InSet, /*IsPCRel=*/false);
}
bool MCObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(
More information about the llvm-commits
mailing list