[llvm] [LTO] Remove an unnecessary cast (NFC) (PR #146275)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 29 09:37:10 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lto

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

&I is already of const uint8_t *.


---
Full diff: https://github.com/llvm/llvm-project/pull/146275.diff


1 Files Affected:

- (modified) llvm/lib/LTO/LTO.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 779c98ee4441e..73e79c08a56ca 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -135,7 +135,7 @@ std::string llvm::computeLTOCacheKey(
     Hasher.update(Data);
   };
   auto AddUint8 = [&](const uint8_t I) {
-    Hasher.update(ArrayRef<uint8_t>((const uint8_t *)&I, 1));
+    Hasher.update(ArrayRef<uint8_t>(&I, 1));
   };
   AddString(Conf.CPU);
   // FIXME: Hash more of Options. For now all clients initialize Options from

``````````

</details>


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


More information about the llvm-commits mailing list