[llvm] [ExecutionEngine] Remove unnecessary casts (NFC) (PR #153931)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 15 23:35:12 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/153931

getLoadAddressWithOffset() and getLoadAddress() already return
uint64_t.


>From c5fc048170615441b08ee7ed96a4208231a3e31e Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 13 Aug 2025 10:47:12 -0700
Subject: [PATCH] [ExecutionEngine] Remove unnecessary casts (NFC)

getLoadAddressWithOffset() and getLoadAddress() already return
uint64_t.
---
 llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index 08d6c78bd1eb1..d6268037dea86 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -654,11 +654,10 @@ bool RuntimeDyldELF::resolveLoongArch64ShortBranch(
     if (Loc == GlobalSymbolTable.end())
       return false;
     const auto &SymInfo = Loc->second;
-    Address =
-        uint64_t(Sections[SymInfo.getSectionID()].getLoadAddressWithOffset(
-            SymInfo.getOffset()));
+    Address = Sections[SymInfo.getSectionID()].getLoadAddressWithOffset(
+        SymInfo.getOffset());
   } else {
-    Address = uint64_t(Sections[Value.SectionID].getLoadAddress());
+    Address = Sections[Value.SectionID].getLoadAddress();
   }
   uint64_t Offset = RelI->getOffset();
   uint64_t SourceAddress = Sections[SectionID].getLoadAddressWithOffset(Offset);



More information about the llvm-commits mailing list