Track a list of dependent instructions created within a generic (#4092)

When checking a declaration or definition of a generic, track a list of
created instructions that depend on the generic's parameters in some
way, along with information on how they depend on the parameters. This
will eventually be used to determine what information we need to compute
when creating instances of the generic, but for now we're just building
the list.

Information is tracked separately for the declaration region and the
definition region of the generic, because in general these may be first
provided in separate declarations, and they should be substituted into
at different times.
This commit is contained in:
Richard Smith
2024-07-01 20:33:44 +00:00
committed by GitHub
parent 177663551b
commit fa11050961
12 changed files with 226 additions and 46 deletions
+1 -1
View File
@@ -338,7 +338,7 @@ static auto HandleFunctionDefinitionAfterSignature(
context.return_scope_stack().push_back({.decl_id = decl_id});
context.inst_block_stack().Push();
context.scope_stack().Push(decl_id);
StartGenericDefinition(context, function.generic_id);
StartGenericDefinition(context);
context.AddCurrentCodeBlockToFunction();
// Check the return type is complete.