Files
carbon-lang/toolchain/base/shared_value_stores.cpp
T
Chandler Carruth 95fc6fae22 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
2026-08-26 00:41:51 +00:00

39 lines
1.5 KiB
C++

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "toolchain/base/shared_value_stores.h"
#include "common/hashing_llvm.h"
#include "toolchain/base/canonical_value_store_impl.h"
#include "toolchain/base/value_store_impl.h"
namespace Carbon {
template class CanonicalValueStore<FloatId, llvm::APFloat>;
template class CanonicalValueStore<IdentifierId, llvm::StringRef>;
template class CanonicalValueStore<StringLiteralValueId, llvm::StringRef>;
template class ValueStore<FloatId, llvm::APFloat>;
template class ValueStore<IdentifierId, llvm::StringRef>;
template class ValueStore<RealId, Real>;
template class ValueStore<StringLiteralValueId, llvm::StringRef>;
auto SharedValueStores::OutputYaml(
std::optional<llvm::StringRef> filename) const -> Yaml::OutputMapping {
return Yaml::OutputMapping([&, filename](Yaml::OutputMapping::Map map) {
if (filename) {
map.Add("filename", *filename);
}
map.Add("shared_values",
Yaml::OutputMapping([&](Yaml::OutputMapping::Map map) {
map.Add("ints", ints_.OutputYaml());
map.Add("reals", reals_.OutputYaml());
map.Add("floats", floats_.OutputYaml());
map.Add("identifiers", identifiers_.OutputYaml());
map.Add("strings", string_literals_.OutputYaml());
}));
});
}
} // namespace Carbon