[llvm] [SPARC][MC] Fix `%gdop_hix22()` and `%gdop_lox10()` to use correct relocations (PR #137915)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri May 2 21:02:33 PDT 2025


MaskRay wrote:

> > ⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️
> 
> This would just be pointless formatting churn in the existing code.

You might add `// clang-format off ` and on if needed, like what I added to SparcMCExpr.cpp

Note: if a fixup kind always leads to a relocation, you can encode its value literally. See
```
% rg R_LARCH_TLS_IE_PC_HI20 llvm/lib/
llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp
214:      FixupKind = ELF::R_LARCH_TLS_IE_PC_HI20;
```
and llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp for examples. 

https://github.com/llvm/llvm-project/pull/137915


More information about the llvm-commits mailing list