Interface CompositeInstr

All Known Implementing Classes:
AssertThrowsInstr, ControlFlowChainInstr, DictLiteralInstr, ForRangePolymorphicInstr, ListLiteralInstr, LogicalOperationInstr, StringInterpolationInstr

An instruction that holds nested instruction lists - THE one statement of which lists a composite has, in which order, and whether each runs once or once per loop iteration. IRStructureWalk (visiting) and IRRewriter (rebuilding) work through it, so no walker or pass re-derives a composite's shape.

Composites are immutable: withNestedLists(UnaryOperator) builds a copy whose lists are the rewritten ones, everything else unchanged, and returns this when the rewrite changed nothing.

  • Method Details

    • nestedLists

      Every nested list, in the order the IR text renders them. Absent (null) lists are omitted.
    • withNestedLists

      IRInstr withNestedLists(UnaryOperator<List<IRInstr>> rewrite)
      A copy with every nested list replaced by rewrite of it - exactly the lists nestedLists() reports, in that order; this when no list changed.