Move TypeCompleter and closely related helper functions to their own file (#4922)

context.cpp is getting large, so I'm looking at a few ways to cut out
clusters of functions. This felt like a logical cluster of functions to
move to their own file.

Note I have two commits in this PR: one moving the functionality to a
new file, and one specifically changing TypeCompleter to use out-of-line
function implementations. This is to assist reviewability.
This commit is contained in:
Jon Ross-Perkins authored and GitHub committed 2025-02-11 18:51:46 +00:00
1 parent 2fef1cb713
commit 0a55081c5d
14 files changed
+746 -627

No files matched your search

+3 -2
View File
@@ -16,6 +16,7 @@
#include "toolchain/check/merge.h"
#include "toolchain/check/modifiers.h"
#include "toolchain/check/name_component.h"
#include "toolchain/check/type_completion.h"
#include "toolchain/sem_ir/builtin_function_kind.h"
#include "toolchain/sem_ir/entry_point.h"
#include "toolchain/sem_ir/function.h"
@@ -375,8 +376,8 @@ static auto CheckFunctionDefinitionSignature(Context& context,
}
// The parameter types need to be complete.
context.RequireCompleteType(
context.insts().GetAs<SemIR::AnyParam>(param_ref_id).type_id,
RequireCompleteType(
context, context.insts().GetAs<SemIR::AnyParam>(param_ref_id).type_id,
context.insts().GetLocId(param_ref_id), [&] {
CARBON_DIAGNOSTIC(
IncompleteTypeInFunctionParam, Error,