mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user