[llvm] a07b374 - [LoongArch] Simplify evaluateAsRelocatableImpl

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 21:15:47 PDT 2025


Author: Fangrui Song
Date: 2025-04-04T21:15:42-07:00
New Revision: a07b37475ccbf6b718fdf64fd6f0756ea1958852

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

LOG: [LoongArch] Simplify evaluateAsRelocatableImpl

Similar to RISCV

Added: 
    

Modified: 
    llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp
index ca3e401d542da..dceb62dcf4604 100644
--- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp
+++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp
@@ -51,7 +51,7 @@ bool LoongArchMCExpr::evaluateAsRelocatableImpl(
 
   Res.setSpecifier(specifier);
   // Custom fixup types are not valid with symbol 
diff erence expressions.
-  return Res.getSymB() ? specifier == VK_None : true;
+  return !Res.getSubSym();
 }
 
 void LoongArchMCExpr::visitUsedExpr(MCStreamer &Streamer) const {


        


More information about the llvm-commits mailing list