Change Context::IsImplFile to File::is_impl (#4931)

Note this mirrors parse_tree().packaging_decl().is_impl, but I'm
preferring to keep the version that doesn't access the parse tree so
that we could change tree storage without hurting as much.
This commit is contained in:
Jon Ross-Perkins
2025-02-12 19:42:07 +00:00
committed by GitHub
parent 71c91eaf14
commit 8af64ceca6
9 changed files with 35 additions and 32 deletions
+3 -2
View File
@@ -11,6 +11,7 @@
#include "toolchain/check/function.h"
#include "toolchain/check/generic.h"
#include "toolchain/check/handle.h"
#include "toolchain/check/import.h"
#include "toolchain/check/import_ref.h"
#include "toolchain/check/interface.h"
#include "toolchain/check/literal.h"
@@ -280,7 +281,7 @@ static auto BuildFunctionDecl(Context& context,
// Create a new function if this isn't a valid redeclaration.
if (!function_decl.function_id.has_value()) {
if (function_info.is_extern && context.IsImplFile()) {
if (function_info.is_extern && context.sem_ir().is_impl()) {
DiagnoseExternRequiresDeclInApiFile(context, node_id);
}
function_info.generic_id = BuildGenericDecl(context, decl_id);
@@ -343,7 +344,7 @@ static auto BuildFunctionDecl(Context& context,
}
}
if (!is_definition && context.IsImplFile() && !is_extern) {
if (!is_definition && context.sem_ir().is_impl() && !is_extern) {
context.definitions_required().push_back(decl_id);
}