mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user