Files
carbon-lang/toolchain/sem_ir/impl.cpp
T
Richard Smith 568ad197d1 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.
2024-10-04 00:06:55 +00:00

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