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
+3 -3
View File
@@ -19,11 +19,11 @@ auto GetCalleeFunction(const File& sem_ir, InstId callee_id) -> CalleeFunction {
}
// Identify the function we're calling.
auto val_id = sem_ir.constant_values().Get(callee_id);
if (!val_id.is_constant()) {
auto val_id = sem_ir.constant_values().GetConstantInstId(callee_id);
if (!val_id.is_valid()) {
return result;
}
auto val_inst = sem_ir.insts().Get(val_id.inst_id());
auto val_inst = sem_ir.insts().Get(val_id);
auto struct_val = val_inst.TryAs<StructValue>();
if (!struct_val) {
result.is_error = val_inst.type_id() == SemIR::TypeId::Error;