Clarify and partially enforce inst-order precondition on splicing (#6722)

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
Geoff Romer
2026-02-14 01:40:51 +00:00
committed by GitHub
co-authored by Chandler Carruth
parent 64e3fab43a
commit f289592dfa
4 changed files with 20 additions and 2 deletions
@@ -160,6 +160,9 @@ auto HandleParseNode(Context& context, Parse::ForHeaderId node_id) -> bool {
// Create the cursor variable.
// TODO: Produce a custom diagnostic if the range operand can't be used as a
// range.
// TODO: We need to allocate the `VarStorage` before building the operator.
// The current order risks violating the preconditions on `Initialize` and
// risks violating the topological ordering of insts.
auto cursor_id =
BuildUnaryOperator(context, node_id,
{.interface_name = CoreIdentifier::Iterate,