Update documentation to match #5355. (#5376)

This commit is contained in:
Richard Smith
2025-04-29 22:47:00 +00:00
committed by GitHub
parent 8eae40646a
commit 98ee8f365e
+10 -3
View File
@@ -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