Rename FormExpr fields for clarity/consistency. (#6746)

This commit is contained in:
Geoff Romer
2026-02-17 17:10:35 +00:00
committed by GitHub
parent 1aa1a2a373
commit f1b6e818d1
5 changed files with 28 additions and 24 deletions
+10 -10
View File
@@ -1249,14 +1249,14 @@ static auto GetReturnTypeExpr(Context& context, SemIR::LocId loc_id,
context.TODO(loc_id, llvm::formatv("Unsupported: return type: {0}",
orig_ret_type.getAsString()));
return {.form_inst_id = SemIR::ErrorInst::InstId,
.type_component_id = SemIR::ErrorInst::TypeInstId,
.type_id = SemIR::ErrorInst::TypeId};
.type_component_inst_id = SemIR::ErrorInst::TypeInstId,
.type_component_id = SemIR::ErrorInst::TypeId};
}
Context::FormExpr result = {
.form_inst_id = is_reference ? make_ref_form(orig_type_inst_id)
: make_init_form(orig_type_inst_id),
.type_component_id = orig_type_inst_id,
.type_id = type_id};
.type_component_inst_id = orig_type_inst_id,
.type_component_id = type_id};
return result;
}
@@ -1265,17 +1265,17 @@ static auto GetReturnTypeExpr(Context& context, SemIR::LocId loc_id,
if (!ctor) {
// void.
return {.form_inst_id = SemIR::InstId::None,
.type_component_id = SemIR::TypeInstId::None,
.type_id = SemIR::TypeId::None};
.type_component_inst_id = SemIR::TypeInstId::None,
.type_component_id = SemIR::TypeId::None};
}
// TODO: Make this a `PartialType`.
SemIR::TypeInstId record_type_inst_id = context.types().GetAsTypeInstId(
LookupClangDeclInstId(context, SemIR::ClangDeclKey(ctor->getParent())));
return {
.form_inst_id = make_init_form(record_type_inst_id),
.type_component_id = record_type_inst_id,
.type_id = context.types().GetTypeIdForTypeInstId(record_type_inst_id)};
return {.form_inst_id = make_init_form(record_type_inst_id),
.type_component_inst_id = record_type_inst_id,
.type_component_id =
context.types().GetTypeIdForTypeInstId(record_type_inst_id)};
}
// Information about a function's declared return type, corresponding to the