Move control flow block functions to their own file. (#4921)

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 this doesn't touch the implementation at all, beyond what's needed
to change from `Context` members to context args.
This commit is contained in:
Jon Ross-Perkins
2025-02-11 21:38:09 +00:00
committed by GitHub
parent 8eb4e24cb6
commit b0d49ba957
10 changed files with 226 additions and 189 deletions
+2 -1
View File
@@ -4,6 +4,7 @@
#include "toolchain/base/kind_switch.h"
#include "toolchain/check/context.h"
#include "toolchain/check/control_flow.h"
#include "toolchain/check/convert.h"
#include "toolchain/check/decl_introducer_state.h"
#include "toolchain/check/decl_name_stack.h"
@@ -445,7 +446,7 @@ auto HandleParseNode(Context& context, Parse::FunctionDefinitionId node_id)
// If the `}` of the function is reachable, reject if we need a return value
// and otherwise add an implicit `return;`.
if (context.is_current_position_reachable()) {
if (IsCurrentPositionReachable(context)) {
if (context.functions()
.Get(function_id)
.return_slot_pattern_id.has_value()) {