Remove inst_id from the public interface of ConstantId. (#4053)

Require mapping from a `ConstantId` to an `InstId` to go through the
`ConstantValueStore`.

This is a preparatory step for an upcoming generics change where
symbolic `ConstantId`s are no longer just a thin wrapper around an
`InstId` but instead are indexes into a table with additional
information about the symbolic constant beyond its `InstId`.
This commit is contained in:
Richard Smith
2024-06-14 00:40:53 +00:00
committed by GitHub
parent e3c15edb92
commit 9029cac727
21 changed files with 167 additions and 128 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ static auto TryMergeRedecl(Context& context, Parse::AnyFunctionDeclId node_id,
// Use the type to get the ID.
if (auto struct_value = context.insts().TryGetAs<SemIR::StructValue>(
context.constant_values().Get(prev_id).inst_id())) {
context.constant_values().GetConstantInstId(prev_id))) {
if (auto function_type = context.types().TryGetAs<SemIR::FunctionType>(
struct_value->type_id)) {
prev_function_id = function_type->function_id;