From 98ee8f365ece2098ceb7127d9401e43feccd7d2a Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 29 Apr 2025 15:47:00 -0700 Subject: [PATCH] Update documentation to match #5355. (#5376) --- toolchain/docs/check/README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/toolchain/docs/check/README.md b/toolchain/docs/check/README.md index ea179f51d395..87d3fd89f0b4 100644 --- a/toolchain/docs/check/README.md +++ b/toolchain/docs/check/README.md @@ -106,9 +106,16 @@ instruction, as described in Instructions are stored as type-erased `SemIR::Inst` objects, which store the instruction kind and the (up to) four fields described above. This balances the -size of `SemIR::Inst` against the overhead of indirection. All instructions have -with them a `LocId` that tracks their source location, and is stored separately -on the `InstStore` and retrieved by `GetLocId()`. +size of `SemIR::Inst` against the overhead of indirection. + +All instructions have with them a `SemIR::LocId` that tracks their source +location, and is stored separately on the `InstStore`. A `LocId` that refers +indirectly to the location of an instruction can be created by calling the +`LocId` constructor: `SemIR::LocId(inst_id)`. You can use +`insts().GetCanonicalLocId(loc_id)` to flatten the location to one that refers +directly to either a parse node or an imported location, but this is typically +necessary only when decomposing the location or when marking it with the +implicit or token-only flags. A `SemIR::InstBlockId`, used to index into `SemIR::InstBlockStore`, can represent a code block. However, it can also be created when a series of