Repository navigation
refactor(ir): create and insert statements at an InsertionPoint - #849
Open
alexcgatea wants to merge 3 commits into
Open
alexcgatea wants to merge 3 commits into
alexcgatea wants to merge 3 commits into
Conversation
Replaces the six insert_* methods with create(point, definition) and insert(point, stmt) for detached statements. UnGraph members are nodes or edge statements as their definition says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Renames check_point to check_insertion_pt and InsertionPoint parameters to insertion_pt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Placing a detached DiGraph member now adds edges to member slots that already read its results, and placing a detached UnGraph edge statement resyncs its wires. Documents that a detached statement never placed leaves its readers dangling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the six
Rewriterinsertion methods with one,create(InsertionPoint, definition), and addsinsert(InsertionPoint, stmt)to place a detached statement.API changes
insert_before/insert_after/insert_terminator/insert_node/insert_ungraph_node/insert_ungraph_edgeare replaced bycreate(insertion_pt, definition). One method, with the insertion point as data:InsertionPoint::{Before, After, Terminator, DiGraph, UnGraph}. AnUnGraphmember is a node or an edge statement according to its definition, soUnexpectedEdgeStatement/ExpectedEdgeStatementare removed.insert(insertion_pt, stmt)places a detached statement of thisRewriter: one it made but has not placed (NotDetachedotherwise). It fits the insertion point under the same rules ascreate. Nothing public makes a detached statement yet; the next PR's clones are the first.Rewriterdrops. Readers of their results are left with dangling operands, whichverify_derivedreports andrun_passquarantines.insertplaces it in a graph, it adds theDiGraphedges andUnGraphwire endpoints to consumers already there. Its regression tests come with the next PR, since they need clones to make a detached statement.