mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
This is necessary in order to have access to the specific versions of their constant values in a generic impl. Stub out impl deduction.
23 lines
777 B
C++
23 lines
777 B
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/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
|