pub fn verify_node_identity(
nodes: &HashMap<AbsPath, HashMap<NodeId, NodeInfo>>,
node_id: NodeId,
expected_abs_path: &str,
expected_name_offset: usize,
expected_name: &str,
) -> boolExpand description
Verify that a NodeId in a specific build refers to the expected source entity.
Node IDs are per-compilation — the same numeric ID can refer to completely
different functions in different builds (e.g. ID 616 = swap in the file
build, but ID 616 = some library function in a sub-cache). This function
checks three properties to confirm the node is the one we expect:
- File — the node must exist in
expected_abs_pathwithin this build. - Position — the node’s
name_locationbyte offset must equalexpected_name_offset. - Name — the source text at the
name_locationmust matchexpected_name.
If all three match the node is guaranteed to be the same source entity, regardless of which compilation produced the build. The check is O(1) — a single HashMap lookup + integer/string comparison.
Returns true if the node passes identity verification.