[llvm] d6bf04f - [LTO] Remove extraneous ArrayRef (NFC) (#90306)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 26 18:38:20 PDT 2024
Author: Kazu Hirata
Date: 2024-04-26T18:38:15-07:00
New Revision: d6bf04f4760b0dff3c3d3ff9b560c04438cc25ac
URL: https://github.com/llvm/llvm-project/commit/d6bf04f4760b0dff3c3d3ff9b560c04438cc25ac
DIFF: https://github.com/llvm/llvm-project/commit/d6bf04f4760b0dff3c3d3ff9b560c04438cc25ac.diff
LOG: [LTO] Remove extraneous ArrayRef (NFC) (#90306)
We don't need to explicitly create these instances of ArrayRef because
Hasher::update takes ArrayRef, and ArrayRef can be implicitly
constructed from C arrays.
Added:
Modified:
llvm/lib/LTO/LTO.cpp
Removed:
################################################################################
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 53060df7f503e0..21cad1de0ced57 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -114,12 +114,12 @@ void llvm::computeLTOCacheKey(
auto AddUnsigned = [&](unsigned I) {
uint8_t Data[4];
support::endian::write32le(Data, I);
- Hasher.update(ArrayRef<uint8_t>{Data, 4});
+ Hasher.update(Data);
};
auto AddUint64 = [&](uint64_t I) {
uint8_t Data[8];
support::endian::write64le(Data, I);
- Hasher.update(ArrayRef<uint8_t>{Data, 8});
+ Hasher.update(Data);
};
AddString(Conf.CPU);
// FIXME: Hash more of Options. For now all clients initialize Options from
More information about the llvm-commits
mailing list