mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Track the instruction used to name the type and constraint in an impl. (#4368)
This is necessary in order to have access to the specific versions of their constant values in a generic impl. Stub out impl deduction.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// 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/sem_ir/impl.h"
|
||||
|
||||
#include "toolchain/sem_ir/file.h"
|
||||
|
||||
namespace Carbon::SemIR {
|
||||
|
||||
auto ImplStore::GetOrAddLookupBucket(const Impl& impl) -> LookupBucketRef {
|
||||
auto self_id = sem_ir_.constant_values().GetConstantInstId(impl.self_id);
|
||||
auto constraint_id =
|
||||
sem_ir_.constant_values().GetConstantInstId(impl.constraint_id);
|
||||
return LookupBucketRef(
|
||||
*this, lookup_
|
||||
.Insert(std::pair{self_id, constraint_id},
|
||||
[] { return ImplOrLookupBucketId::Invalid; })
|
||||
.value());
|
||||
}
|
||||
|
||||
} // namespace Carbon::SemIR
|
||||
Reference in New Issue
Block a user