mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:34:45 +01:00
Add a ValueT to RelationalValueStore (#5755)
RelationalValueStore is only used in one spot, so starting there.
This commit is contained in:
@@ -30,11 +30,11 @@ namespace Carbon {
|
||||
// requires storing a bit for presence of each `RelatedIdT`. And it allocates
|
||||
// memory for values for all IDs up largest ID present in the store, even if
|
||||
// they are not yet used.
|
||||
template <typename RelatedIdT, typename IdT>
|
||||
template <typename RelatedIdT, typename IdT, typename ValueT>
|
||||
class RelationalValueStore {
|
||||
public:
|
||||
using ValueType = ValueStoreTypes<IdT>::ValueType;
|
||||
using ConstRefType = ValueStoreTypes<IdT>::ConstRefType;
|
||||
using ValueType = ValueStoreTypes<IdT, ValueT>::ValueType;
|
||||
using ConstRefType = ValueStoreTypes<IdT, ValueT>::ConstRefType;
|
||||
|
||||
// Given the related ID and a value, stores the value and returns a mapped ID
|
||||
// to reference it in the store.
|
||||
|
||||
@@ -62,7 +62,8 @@ struct ExprRegion {
|
||||
class File : public Printable<File> {
|
||||
public:
|
||||
using IdentifiedFacetTypeStore =
|
||||
RelationalValueStore<FacetTypeId, IdentifiedFacetTypeId>;
|
||||
RelationalValueStore<FacetTypeId, IdentifiedFacetTypeId,
|
||||
IdentifiedFacetType>;
|
||||
|
||||
// Starts a new file for Check::CheckParseTree.
|
||||
explicit File(const Parse::Tree* parse_tree, CheckIRId check_ir_id,
|
||||
|
||||
@@ -36,7 +36,6 @@ struct ExprRegion;
|
||||
struct FacetTypeInfo;
|
||||
struct Function;
|
||||
struct Generic;
|
||||
struct IdentifiedFacetType;
|
||||
struct Specific;
|
||||
struct SpecificInterface;
|
||||
struct ImportCpp;
|
||||
@@ -331,7 +330,6 @@ struct FacetTypeId : public IdBase<FacetTypeId> {
|
||||
// The ID of an resolved facet type value.
|
||||
struct IdentifiedFacetTypeId : public IdBase<IdentifiedFacetTypeId> {
|
||||
static constexpr llvm::StringLiteral Label = "identified_facet_type";
|
||||
using ValueType = IdentifiedFacetType;
|
||||
|
||||
using IdBase::IdBase;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user