mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 20:50:29 +00:00
Support arbitrary parameter forms in MakeGeneratedFunctionDecl (#7654)
This allows generated functions to have different forms for different parameters, and by-ref or by-value return forms. As a byproduct, this allows generated functions to supply a return type _inst_ ID when they have one, which preserves things like location information.
This commit is contained in:
1 parent
0745bda899
commit
1410795bf7
10 files changed
+146
-132
No files matched your search
@@ -271,8 +271,9 @@ static auto MakeCppStdInitializerListMake(Context& context, SemIR::LocId loc_id,
|
||||
{.parent_scope_id = init_list_class.scope_id,
|
||||
.name_id = init_list_class.name_id,
|
||||
.param_type_ids = {array_type_id},
|
||||
.param_kind = ParamPatternKind::Value,
|
||||
.return_type_id = init_list_type_id});
|
||||
.param_kinds = {ParamPatternKind::Value},
|
||||
.return_form = ReturnExprAsForm(
|
||||
context, loc_id, init_list_type_inst_id)});
|
||||
|
||||
auto& function = context.functions().Get(function_id);
|
||||
CARBON_CHECK(IsValidBuiltinDeclaration(
|
||||
|
||||
Reference in new issue
Block a user