Skip to content

Commit

Permalink
cleanup/fix/combine combine Block --- AST --> Local relationship (S…
Browse files Browse the repository at this point in the history
  • Loading branch information
mpollmeier authored Nov 29, 2023
1 parent 674836a commit ffddba6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,6 @@ class Block(graph_4762: Graph, id_4762: Long /*cf https://github.com/scala/bug/i
*/
def _literalViaAstOut: overflowdb.traversal.Traversal[Literal] = get()._literalViaAstOut

/** Traverse to LOCAL via AST OUT edge.
*/
def _localViaAstOut: overflowdb.traversal.Traversal[Local] = get()._localViaAstOut

/** Traverse to locals of this block. Traverse to LOCAL via AST OUT edge.
*/
/** Traverse to locals of this block. */
Expand Down Expand Up @@ -759,7 +755,6 @@ class BlockDb(ref: NodeRef[NodeDb]) extends NodeDb(ref) with StoredNode with Exp
def _importViaAstOut: overflowdb.traversal.Traversal[Import] = astOut.collectAll[Import]
def _jumpTargetViaAstOut: overflowdb.traversal.Traversal[JumpTarget] = astOut.collectAll[JumpTarget]
def _literalViaAstOut: overflowdb.traversal.Traversal[Literal] = astOut.collectAll[Literal]
def _localViaAstOut: overflowdb.traversal.Traversal[Local] = astOut.collectAll[Local]
def local: overflowdb.traversal.Traversal[Local] = astOut.collectAll[Local]
def _methodRefViaAstOut: overflowdb.traversal.Traversal[MethodRef] = astOut.collectAll[MethodRef]
def _returnViaAstOut: overflowdb.traversal.Traversal[Return] = astOut.collectAll[Return]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ class Local(graph_4762: Graph, id_4762: Long /*cf https://github.com/scala/bug/i
def astIn: Iterator[Expression] = get().astIn
override def _astIn = get()._astIn

/** Traverse to BLOCK via AST IN edge.
*/
def _blockViaAstIn: overflowdb.traversal.Traversal[Block] = get()._blockViaAstIn

/** The block in which local is declared. Traverse to BLOCK via AST IN edge.
*/
/** The block in which local is declared. */
Expand Down Expand Up @@ -299,10 +295,9 @@ class LocalDb(ref: NodeRef[NodeDb]) extends NodeDb(ref) with StoredNode with Ast
override def _taggedByOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](2)
def _tagViaTaggedByOut: overflowdb.traversal.Traversal[Tag] = taggedByOut.collectAll[Tag]

def astIn: Iterator[Expression] = createAdjacentNodeScalaIteratorByOffSet[Expression](3)
override def _astIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](3)
def _blockViaAstIn: overflowdb.traversal.Traversal[Block] = astIn.collectAll[Block]
def definingBlock: overflowdb.traversal.Traversal[Block] = astIn.collectAll[Block]
def astIn: Iterator[Expression] = createAdjacentNodeScalaIteratorByOffSet[Expression](3)
override def _astIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](3)
def definingBlock: overflowdb.traversal.Traversal[Block] = astIn.collectAll[Block]
def _controlStructureViaAstIn: overflowdb.traversal.Traversal[ControlStructure] = astIn.collectAll[ControlStructure]
def _unknownViaAstIn: overflowdb.traversal.Traversal[Unknown] = astIn.collectAll[Unknown]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,9 @@ object Ast extends SchemaBase {
edge = ast,
inNode = local,
stepNameIn = "definingBlock",
stepNameInDoc = "The block in which local is declared."
stepNameInDoc = "The block in which local is declared.",
stepNameOut = "local",
stepNameOutDoc = "Traverse to locals of this block."
)
.addOutEdge(edge = ast, inNode = unknown)
.addOutEdge(edge = ast, inNode = jumpTarget)
Expand Down Expand Up @@ -609,14 +611,7 @@ object Ast extends SchemaBase {
unknown.addOutEdge(edge = ast, inNode = callNode)
controlStructure.addOutEdge(edge = condition, inNode = callNode)

block
.addOutEdge(edge = ast, inNode = callNode)
.addOutEdge(
edge = ast,
inNode = local,
stepNameOut = "local",
stepNameOutDoc = "Traverse to locals of this block."
)
block.addOutEdge(edge = ast, inNode = callNode)

// To refactor

Expand Down

0 comments on commit ffddba6

Please sign in to comment.