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 -1
View File
@@ -13,6 +13,7 @@
#include "toolchain/check/context.h"
#include "toolchain/check/convert.h"
#include "toolchain/check/subpattern.h"
#include "toolchain/check/type.h"
namespace Carbon::Check {
@@ -252,7 +253,7 @@ auto MatchContext::EmitPatternMatch(Context& context,
auto scrutinee_ref = context.insts().Get(scrutinee_ref_id);
auto new_scrutinee = context.AddInst<SemIR::AddrOf>(
context.insts().GetLocId(scrutinee_ref_id),
{.type_id = context.GetPointerType(scrutinee_ref.type_id()),
{.type_id = GetPointerType(context, scrutinee_ref.type_id()),
.lvalue_id = scrutinee_ref_id});
AddWork(
{.pattern_id = addr_pattern.inner_id, .scrutinee_id = new_scrutinee});