[llvm] f336c90 - LoongArch: Use mc::isRelocation. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 18 19:37:57 PDT 2025
Author: Fangrui Song
Date: 2025-04-18T19:37:52-07:00
New Revision: f336c908cdae0135d05763e4bb05913d27076fc8
URL: https://github.com/llvm/llvm-project/commit/f336c908cdae0135d05763e4bb05913d27076fc8
DIFF: https://github.com/llvm/llvm-project/commit/f336c908cdae0135d05763e4bb05913d27076fc8.diff
LOG: LoongArch: Use mc::isRelocation. NFC
Added:
Modified:
llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
index 78a54a9385b08..75cb0b587e0a6 100644
--- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
+++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
@@ -70,7 +70,7 @@ LoongArchAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
// Fixup kinds from .reloc directive are like R_LARCH_NONE. They
// do not require any extra processing.
- if (unsigned(Kind) >= FirstRelocationKind)
+ if (mc::isRelocation(Kind))
return MCAsmBackend::getFixupKindInfo(FK_NONE);
if (Kind < FirstTargetFixupKind)
@@ -152,10 +152,10 @@ void LoongArchAsmBackend::applyFixup(const MCAssembler &Asm,
if (!Value)
return; // Doesn't change encoding.
- auto Kind = Fixup.getTargetKind();
- if (Kind >= FirstRelocationKind)
+ auto Kind = Fixup.getKind();
+ if (mc::isRelocation(Kind))
return;
- MCFixupKindInfo Info = getFixupKindInfo(MCFixupKind(Kind));
+ MCFixupKindInfo Info = getFixupKindInfo(Kind);
MCContext &Ctx = Asm.getContext();
// Fixup leb128 separately.
More information about the llvm-commits
mailing list