mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:10:12 +01:00
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:
@@ -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, ...});
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user