mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 09:51:04 +01:00
Move diagnostic helpers from Context to other files (#4949)
Trying to find more specific homes for shared diagnostic function calls.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "toolchain/check/merge.h"
|
||||
#include "toolchain/check/modifiers.h"
|
||||
#include "toolchain/check/name_component.h"
|
||||
#include "toolchain/check/name_lookup.h"
|
||||
#include "toolchain/sem_ir/typed_insts.h"
|
||||
|
||||
namespace Carbon::Check {
|
||||
@@ -65,8 +66,8 @@ static auto BuildInterfaceDecl(Context& context,
|
||||
introducer.modifier_set.GetAccessKind());
|
||||
if (lookup_result.is_poisoned()) {
|
||||
// This is a declaration of a poisoned name.
|
||||
context.DiagnosePoisonedName(lookup_result.poisoning_loc_id(),
|
||||
name_context.loc_id);
|
||||
DiagnosePoisonedName(context, lookup_result.poisoning_loc_id(),
|
||||
name_context.loc_id);
|
||||
} else if (lookup_result.is_found()) {
|
||||
SemIR::InstId existing_id = lookup_result.target_inst_id();
|
||||
if (auto existing_interface_decl =
|
||||
@@ -102,7 +103,7 @@ static auto BuildInterfaceDecl(Context& context,
|
||||
}
|
||||
} else {
|
||||
// This is a redeclaration of something other than a interface.
|
||||
context.DiagnoseDuplicateName(interface_decl_id, existing_id);
|
||||
DiagnoseDuplicateName(context, interface_decl_id, existing_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user