mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Remove SemIR:: from most sem_ir files (#5358)
This is just cleanup, at least some from LocId replacements. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
d2826ae841
commit
949cc21ccc
@@ -23,10 +23,10 @@ static auto FollowImportRef(
|
||||
|
||||
auto import_loc_id = cursor_ir->insts().GetLocId(import_ir.decl_id);
|
||||
switch (import_loc_id.kind()) {
|
||||
case SemIR::LocId::Kind::None:
|
||||
case LocId::Kind::None:
|
||||
break;
|
||||
|
||||
case SemIR::LocId::Kind::ImportIRInstId: {
|
||||
case LocId::Kind::ImportIRInstId: {
|
||||
// For implicit imports, we need to unravel the location a little
|
||||
// further.
|
||||
auto implicit_import_ir_inst =
|
||||
@@ -35,7 +35,7 @@ static auto FollowImportRef(
|
||||
cursor_ir->import_irs().Get(implicit_import_ir_inst.ir_id());
|
||||
auto implicit_loc_id = implicit_ir.sem_ir->insts().GetLocId(
|
||||
implicit_import_ir_inst.inst_id());
|
||||
CARBON_CHECK(implicit_loc_id.kind() == SemIR::LocId::Kind::NodeId,
|
||||
CARBON_CHECK(implicit_loc_id.kind() == LocId::Kind::NodeId,
|
||||
"Should only be one layer of implicit imports");
|
||||
absolute_node_ids.push_back(
|
||||
{.check_ir_id = implicit_ir.sem_ir->check_ir_id(),
|
||||
@@ -43,10 +43,10 @@ static auto FollowImportRef(
|
||||
break;
|
||||
}
|
||||
|
||||
case SemIR::LocId::Kind::InstId:
|
||||
case LocId::Kind::InstId:
|
||||
CARBON_FATAL("Unexpected LocId: {0}", import_loc_id);
|
||||
|
||||
case SemIR::LocId::Kind::NodeId: {
|
||||
case LocId::Kind::NodeId: {
|
||||
// For imports in the current file, the location is simple.
|
||||
absolute_node_ids.push_back({.check_ir_id = cursor_ir->check_ir_id(),
|
||||
.node_id = import_loc_id.node_id()});
|
||||
@@ -64,21 +64,21 @@ static auto HandleLocId(llvm::SmallVector<AbsoluteNodeId>& absolute_node_ids,
|
||||
const File*& cursor_ir, InstId& cursor_inst_id,
|
||||
LocId loc_id) -> bool {
|
||||
switch (loc_id.kind()) {
|
||||
case SemIR::LocId::Kind::ImportIRInstId: {
|
||||
case LocId::Kind::ImportIRInstId: {
|
||||
FollowImportRef(absolute_node_ids, cursor_ir, cursor_inst_id,
|
||||
loc_id.import_ir_inst_id());
|
||||
return false;
|
||||
}
|
||||
|
||||
case SemIR::LocId::Kind::NodeId: {
|
||||
case LocId::Kind::NodeId: {
|
||||
// Parse nodes always refer to the current IR.
|
||||
absolute_node_ids.push_back({.check_ir_id = cursor_ir->check_ir_id(),
|
||||
.node_id = loc_id.node_id()});
|
||||
return true;
|
||||
}
|
||||
|
||||
case SemIR::LocId::Kind::None:
|
||||
case SemIR::LocId::Kind::InstId:
|
||||
case LocId::Kind::None:
|
||||
case LocId::Kind::InstId:
|
||||
CARBON_FATAL("Unexpected LocId: {0}", loc_id);
|
||||
}
|
||||
}
|
||||
@@ -123,17 +123,17 @@ auto GetAbsoluteNodeId(const File* sem_ir, LocId loc_id)
|
||||
-> llvm::SmallVector<AbsoluteNodeId> {
|
||||
llvm::SmallVector<AbsoluteNodeId> absolute_node_ids;
|
||||
switch (loc_id.kind()) {
|
||||
case SemIR::LocId::Kind::None:
|
||||
case LocId::Kind::None:
|
||||
absolute_node_ids.push_back({.check_ir_id = sem_ir->check_ir_id(),
|
||||
.node_id = Parse::NodeId::None});
|
||||
break;
|
||||
|
||||
case SemIR::LocId::Kind::InstId:
|
||||
case LocId::Kind::InstId:
|
||||
GetAbsoluteNodeIdImpl(absolute_node_ids, sem_ir, loc_id.inst_id());
|
||||
break;
|
||||
|
||||
case SemIR::LocId::Kind::ImportIRInstId:
|
||||
case SemIR::LocId::Kind::NodeId: {
|
||||
case LocId::Kind::ImportIRInstId:
|
||||
case LocId::Kind::NodeId: {
|
||||
const File* cursor_ir = sem_ir;
|
||||
InstId cursor_inst_id = InstId::None;
|
||||
if (HandleLocId(absolute_node_ids, cursor_ir, cursor_inst_id, loc_id)) {
|
||||
|
||||
Reference in New Issue
Block a user