Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kazutakahirata
Copy link
Contributor

&I is already of const uint8_t *.

&I is already of const uint8_t *.
@llvmbot llvmbot added the LTO Link time optimization (regular/full LTO or ThinLTO) label Jun 29, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 29, 2025

@llvm/pr-subscribers-lto

Author: Kazu Hirata (kazutakahirata)

Changes

&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 --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

@kazutakahirata kazutakahirata merged commit 72c0fc2 into llvm:main Jun 30, 2025
9 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250629_cast_llvm_LTO branch June 30, 2025 02:19
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTO Link time optimization (regular/full LTO or ThinLTO)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants