common: Decouple LLVM hashing dependencies from common/hashing.h (#7646)

- Move formatted printing to `hashing.cpp` instead of `hashing.h`
- Separate APInt and APFloat hashing specializations into a new
`hashing_llvm.h`
- Update toolchain/base dependencies and include sites that hash LLVM
data types to include `hashing_llvm.h`

Combined, this reduces the transitive includes caused by `hashing.h`.

Assisted-by: Antigravity with Gemini
This commit is contained in:
Chandler Carruth
2026-08-26 00:41:51 +00:00
committed by GitHub
parent c7dcc50768
commit 95fc6fae22
12 changed files with 103 additions and 44 deletions
+6
View File
@@ -6,8 +6,14 @@
#include <cstddef>
#include "llvm/Support/FormatVariadic.h"
namespace Carbon {
auto HashCode::Print(llvm::raw_ostream& out) const -> void {
out << llvm::formatv("{0:x16}", value_);
}
auto Hasher::HashSizedBytesLarge(llvm::ArrayRef<std::byte> bytes) -> void {
const std::byte* data_ptr = bytes.data();
const ssize_t size = bytes.size();