Add a SemIR scope for generated entities (#6792)

This currently doesn't include much, but we expect to be generating more
entities, such as `Destroy`, which I'm aiming to get more clearly
categorized here instead of `imports`.

Assisted-by: Google Antigravity with Gemini 3 Flash

---------

Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
Jon Ross-Perkins
2026-02-25 22:00:59 +00:00
committed by GitHub
co-authored by Dana Jansens
parent af368dbadd
commit c6bc033af8
20 changed files with 462 additions and 393 deletions
+1 -3
View File
@@ -185,11 +185,9 @@ auto MakeBuiltinFunction(Context& context, SemIR::LocId loc_id,
.return_patterns_id = return_patterns_id,
.self_param_id = self_param_id,
}});
// Add the builtin to the imports block so that it appears in the formatted
// IR.
// TODO: Find a better way to handle this. Ideally we should stop using this
// function entirely and declare builtins in the prelude.
context.imports().push_back(decl_id);
context.generated().push_back(decl_id);
auto& function = context.functions().Get(function_id);
CARBON_CHECK(IsValidBuiltinDeclaration(context, function, builtin_kind));