Move type functions off Context (#4951)

This creates a new check/type.h for most logic, and also moves some
functions to TypeStore in sem_ir/type.h. My approach for TypeStore is to
focus on moving the read-only functions there.
This commit is contained in:
Jon Ross-Perkins authored and GitHub committed 2025-02-13 23:02:38 +00:00
1 parent 23e5677c8e
commit dc8f47e6ad
39 files changed
+506 -393

No files matched your search

+2 -1
View File
@@ -11,6 +11,7 @@
#include "toolchain/check/import_ref.h"
#include "toolchain/check/merge.h"
#include "toolchain/check/name_lookup.h"
#include "toolchain/check/type.h"
#include "toolchain/parse/node_ids.h"
#include "toolchain/sem_ir/file.h"
#include "toolchain/sem_ir/ids.h"
@@ -508,7 +509,7 @@ static auto AddNamespaceFromOtherPackage(Context& context,
SemIR::NameId name_id)
-> SemIR::InstId {
auto namespace_type_id =
context.GetSingletonType(SemIR::NamespaceType::SingletonInstId);
GetSingletonType(context, SemIR::NamespaceType::SingletonInstId);
AddImportNamespaceResult result = CopySingleNameScopeFromImportIR(
context, namespace_type_id, /*copied_namespaces=*/nullptr, import_ir_id,
import_inst_id, import_ns.name_scope_id, parent_scope_id, name_id);