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
2025-02-11 18:51:46 +00:00
committed by GitHub
parent 2fef1cb713
commit 0a55081c5d
14 changed files with 746 additions and 627 deletions
+4 -3
View File
@@ -5,6 +5,7 @@
#include "toolchain/check/function.h"
#include "toolchain/check/merge.h"
#include "toolchain/check/type_completion.h"
#include "toolchain/sem_ir/ids.h"
namespace Carbon::Check {
@@ -96,9 +97,9 @@ auto CheckFunctionReturnType(Context& context, SemIR::LocId loc_id,
// TODO: Consider suppressing the diagnostic if we've already diagnosed a
// definition or call to this function.
if (context.RequireConcreteType(return_info.type_id, loc_id,
diagnose_incomplete_return_type,
diagnose_abstract_return_type)) {
if (RequireConcreteType(context, return_info.type_id, loc_id,
diagnose_incomplete_return_type,
diagnose_abstract_return_type)) {
return_info = SemIR::ReturnTypeInfo::ForFunction(context.sem_ir(),
function, specific_id);
}