[llvm] [JITLink][RISC-V] Support R_RISCV_SET_ULEB128/R_RISCV_SUB_ULEB128 for… (PR #153778)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 15 03:20:58 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- llvm/include/llvm/ExecutionEngine/JITLink/riscv.h llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp llvm/lib/ExecutionEngine/JITLink/riscv.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp b/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
index 8830d023a..cfd14a4da 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
@@ -193,7 +193,8 @@ private:
"for LO12 PCREL relocation type");
}
- Expected<const Edge &> getRISCVSetULEB128(const Block &B, const Edge &E) const {
+ Expected<const Edge &> getRISCVSetULEB128(const Block &B,
+ const Edge &E) const {
using namespace riscv;
assert(E.getKind() == R_RISCV_SUB_ULEB128 &&
"Can only have pair relocation for R_RISCV_SET_ULEB128 or");
@@ -202,7 +203,8 @@ private:
if (It != SetULEB128.end())
return *It->second;
- return make_error<JITLinkError>("No RISCV_SET_ULEB128 relocation type be found");
+ return make_error<JITLinkError>(
+ "No RISCV_SET_ULEB128 relocation type be found");
}
Error applyFixup(LinkGraph &G, Block &B, const Edge &E) const {
@@ -490,8 +492,8 @@ private:
if (!SetULEB128)
return SetULEB128.takeError();
uint64_t Value = SetULEB128->getTarget().getAddress() +
- SetULEB128->getAddend() - E.getTarget().getAddress() -
- E.getAddend();
+ SetULEB128->getAddend() - E.getTarget().getAddress() -
+ E.getAddend();
encodeULEB128(Value, (reinterpret_cast<uint8_t *>(FixupPtr)));
break;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/153778
More information about the llvm-commits
mailing list