mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +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:
@@ -6,6 +6,7 @@
|
||||
#include "toolchain/check/context.h"
|
||||
#include "toolchain/check/convert.h"
|
||||
#include "toolchain/check/handle.h"
|
||||
#include "toolchain/check/type.h"
|
||||
#include "toolchain/diagnostics/format_providers.h"
|
||||
|
||||
namespace Carbon::Check {
|
||||
@@ -141,8 +142,8 @@ auto HandleParseNode(Context& context, Parse::StructLiteralId node_id) -> bool {
|
||||
/*is_struct_type_literal=*/false)) {
|
||||
context.node_stack().Push(node_id, SemIR::ErrorInst::SingletonInstId);
|
||||
} else {
|
||||
auto type_id = context.GetStructType(
|
||||
context.struct_type_fields().AddCanonical(fields));
|
||||
auto type_id = GetStructType(
|
||||
context, context.struct_type_fields().AddCanonical(fields));
|
||||
|
||||
auto value_id = context.AddInst<SemIR::StructLiteral>(
|
||||
node_id, {.type_id = type_id, .elements_id = elements_id});
|
||||
|
||||
Reference in New Issue
Block a user