mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:21:21 +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:
@@ -10,6 +10,7 @@
|
||||
#include "toolchain/check/eval.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/merge.h"
|
||||
#include "toolchain/check/modifiers.h"
|
||||
@@ -265,7 +266,7 @@ static auto BuildClassDecl(Context& context, Parse::AnyClassDeclId node_id,
|
||||
.specific_id = specific_id}));
|
||||
}
|
||||
|
||||
if (!is_definition && context.IsImplFile() && !is_extern) {
|
||||
if (!is_definition && context.sem_ir().is_impl() && !is_extern) {
|
||||
context.definitions_required().push_back(class_decl_id);
|
||||
}
|
||||
|
||||
@@ -333,7 +334,8 @@ static auto DiagnoseClassSpecificDeclOutsideClass(Context& context,
|
||||
static auto GetCurrentScopeAsClassOrDiagnose(Context& context, SemIRLoc loc,
|
||||
Lex::TokenKind tok)
|
||||
-> std::optional<SemIR::ClassDecl> {
|
||||
auto class_scope = context.GetCurrentScopeAs<SemIR::ClassDecl>();
|
||||
auto class_scope =
|
||||
context.scope_stack().GetCurrentScopeAs<SemIR::ClassDecl>();
|
||||
if (!class_scope) {
|
||||
DiagnoseClassSpecificDeclOutsideClass(context, loc, tok);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user