mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 01:20:33 +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
@@ -1294,6 +1294,8 @@ static auto BuildCarbonToCarbonThunk(Context& context, SemIR::LocId loc_id,
|
||||
thunk_param_type_ids.end());
|
||||
}
|
||||
|
||||
llvm::SmallVector<ParamPatternKind> thunk_param_kinds(
|
||||
thunk_param_type_ids.size(), ParamPatternKind::Ref);
|
||||
auto carbon_thunk_function_id =
|
||||
MakeGeneratedFunctionDecl(
|
||||
context, loc_id,
|
||||
@@ -1301,7 +1303,7 @@ static auto BuildCarbonToCarbonThunk(Context& context, SemIR::LocId loc_id,
|
||||
.name_id = thunk_name_id,
|
||||
.self_type_id = target.GetSelfTypeId(),
|
||||
.param_type_ids = thunk_param_type_ids,
|
||||
.param_kind = ParamPatternKind::Ref})
|
||||
.param_kinds = thunk_param_kinds})
|
||||
.second;
|
||||
|
||||
BuildThunkDefinitionForExport(
|
||||
|
||||
Reference in new issue
Block a user