Files
carbon-lang/toolchain/sem_ir/absolute_node_id.h
T
Jon Ross-Perkins 9759387a13 Collapse GetAbsoluteNodeId overload (#5298)
Since LocId can handle a NodeId, this overload isn't really needed
anymore. Probably helpful to simplify.
2025-04-12 00:30:19 +00:00

30 lines
986 B
C++

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef CARBON_TOOLCHAIN_SEM_IR_ABSOLUTE_NODE_ID_H_
#define CARBON_TOOLCHAIN_SEM_IR_ABSOLUTE_NODE_ID_H_
#include "toolchain/parse/tree_and_subtrees.h"
#include "toolchain/sem_ir/file.h"
#include "toolchain/sem_ir/ids.h"
namespace Carbon::SemIR {
// A specific node location in a file.
struct AbsoluteNodeId {
CheckIRId check_ir_id;
Parse::NodeId node_id;
};
// Resolves the `LocId` to a series of `NodeId`s, which may be in different
// files. The vector will have one entry if there were no imports, and multiple
// entries when imports are traversed. The final entry is the actual
// declaration.
auto GetAbsoluteNodeId(const File* sem_ir, LocId loc_id)
-> llvm::SmallVector<AbsoluteNodeId>;
} // namespace Carbon::SemIR
#endif // CARBON_TOOLCHAIN_SEM_IR_ABSOLUTE_NODE_ID_H_