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
2025-02-13 23:02:38 +00:00
committed by GitHub
parent 23e5677c8e
commit dc8f47e6ad
39 changed files with 506 additions and 393 deletions
+2 -2
View File
@@ -298,11 +298,11 @@ If the resulting SemIR needs a new instruction:
constructed as a special-case in
[`File` construction](/toolchain/sem_ir/file.cpp). To get a type id for
one of these builtin types, use something like
`context.GetSingletonType(SemIR::WitnessType::SingletonInstId)`, as in:
`GetSingletonType(context,SemIR::WitnessType::SingletonInstId)`, as in:
```
SemIR::TypeId witness_type_id =
context.GetSingletonType(SemIR::WitnessType::SingletonInstId);
GetSingletonType(context,SemIR::WitnessType::SingletonInstId);
SemIR::InstId inst_id = context.AddInst<SemIR::NewInstKindName>(
node_id, {.type_id = witness_type_id, ...});
```