Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ other words, there is a (name, signature) pair that can be resolved for the type
 | */
public static final String IS_CALL_FOR_IMPORT = "IS_CALL_FOR_IMPORT";

/** The edge connects jump-like control structures to the node encoding their jump target. */
public static final String JUMP_ARGUMENT = "JUMP_ARGUMENT";

/** This edge connects a method input parameter to the corresponding
method output parameter. */
public static final String PARAMETER_LINK = "PARAMETER_LINK";
Expand Down Expand Up @@ -156,6 +159,7 @@ other words, there is a (name, signature) pair that can be resolved for the type
add(IMPORTS);
add(INHERITS_FROM);
add(IS_CALL_FOR_IMPORT);
add(JUMP_ARGUMENT);
add(PARAMETER_LINK);
add(POST_DOMINATE);
add(REACHING_DEF);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ object GraphSchema extends flatgraph.Schema {
"IMPORTS",
"INHERITS_FROM",
"IS_CALL_FOR_IMPORT",
"JUMP_ARGUMENT",
"PARAMETER_LINK",
"POST_DOMINATE",
"REACHING_DEF",
Expand Down Expand Up @@ -112,7 +113,8 @@ object GraphSchema extends flatgraph.Schema {
size => null,
size => null,
size => null,
size => Array.fill(size)("<empty>") /* label = REACHING_DEF, id = 26 */,
size => null,
size => Array.fill(size)("<empty>") /* label = REACHING_DEF, id = 27 */,
size => null,
size => null,
size => null,
Expand Down Expand Up @@ -190,6 +192,7 @@ object GraphSchema extends flatgraph.Schema {
(s, d, subseq, p) => new edges.Imports(s, d, subseq, p),
(s, d, subseq, p) => new edges.InheritsFrom(s, d, subseq, p),
(s, d, subseq, p) => new edges.IsCallForImport(s, d, subseq, p),
(s, d, subseq, p) => new edges.JumpArgument(s, d, subseq, p),
(s, d, subseq, p) => new edges.ParameterLink(s, d, subseq, p),
(s, d, subseq, p) => new edges.PostDominate(s, d, subseq, p),
(s, d, subseq, p) => new edges.ReachingDef(s, d, subseq, p),
Expand Down Expand Up @@ -1477,7 +1480,7 @@ object GraphSchema extends flatgraph.Schema {
_newNodeInserters
}
override def getNumberOfNodeKinds: Int = 43
override def getNumberOfEdgeKinds: Int = 33
override def getNumberOfEdgeKinds: Int = 34
override def getNodeLabel(nodeKind: Int): String = nodeLabels(nodeKind)
override def getNodeKindByLabel(label: String): Int = nodeKindByLabel.getOrElse(label, flatgraph.Schema.UndefinedKind)
override def getEdgeLabel(nodeKind: Int, edgeKind: Int): String = edgeLabels(edgeKind)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,29 +192,37 @@ object IsCallForImport {
class IsCallForImport(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 23, subSeq_4862, property_4862) {}

object JumpArgument {
val Label = "JUMP_ARGUMENT"

}

class JumpArgument(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 24, subSeq_4862, property_4862) {}

object ParameterLink {
val Label = "PARAMETER_LINK"

}

class ParameterLink(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 24, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 25, subSeq_4862, property_4862) {}

object PostDominate {
val Label = "POST_DOMINATE"

}

class PostDominate(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 25, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 26, subSeq_4862, property_4862) {}

object ReachingDef {
val Label = "REACHING_DEF"
val propertyName: Option[String] = Some("VARIABLE")
}

class ReachingDef(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 26, subSeq_4862, property_4862) {
extends flatgraph.Edge(src_4762, dst_4762, 27, subSeq_4862, property_4862) {
override def propertyName: Option[String] = ReachingDef.propertyName
}

Expand All @@ -224,44 +232,44 @@ object Receiver {
}

class Receiver(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 27, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 28, subSeq_4862, property_4862) {}

object Ref {
val Label = "REF"

}

class Ref(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 28, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 29, subSeq_4862, property_4862) {}

object SourceFile {
val Label = "SOURCE_FILE"

}

class SourceFile(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 29, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 30, subSeq_4862, property_4862) {}

object TaggedBy {
val Label = "TAGGED_BY"

}

class TaggedBy(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 30, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 31, subSeq_4862, property_4862) {}

object TrueBody {
val Label = "TRUE_BODY"

}

class TrueBody(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 31, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 32, subSeq_4862, property_4862) {}

object TryBody {
val Label = "TRY_BODY"

}

class TryBody(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 32, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 33, subSeq_4862, property_4862) {}
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ final class AccessNeighborsForControlStructure(val node: nodes.ControlStructure)
*/
def _jumpLabelViaAstOut: Iterator[nodes.JumpLabel] = astOut.collectAll[nodes.JumpLabel]

/** Traverse to JUMP_LABEL via JUMP_ARGUMENT OUT edge.
*/
def _jumpLabelViaJumpArgumentOut: Iterator[nodes.JumpLabel] = jumpArgumentOut.collectAll[nodes.JumpLabel]

/** Traverse to JUMP_TARGET via AST OUT edge.
*/
def _jumpTargetViaAstOut: Iterator[nodes.JumpTarget] = astOut.collectAll[nodes.JumpTarget]
Expand Down Expand Up @@ -507,6 +511,10 @@ final class AccessNeighborsForControlStructure(val node: nodes.ControlStructure)
*/
def _literalViaForUpdateOut: Iterator[nodes.Literal] = forUpdateOut.collectAll[nodes.Literal]

/** Traverse to LITERAL via JUMP_ARGUMENT OUT edge.
*/
def _literalViaJumpArgumentOut: Iterator[nodes.Literal] = jumpArgumentOut.collectAll[nodes.Literal]

/** Traverse to LITERAL via POST_DOMINATE IN edge.
*/
def _literalViaPostDominateIn: Iterator[nodes.Literal] = postDominateIn.collectAll[nodes.Literal]
Expand Down Expand Up @@ -912,6 +920,8 @@ final class AccessNeighborsForControlStructure(val node: nodes.ControlStructure)

def forUpdateOut: Iterator[nodes.CfgNode] = node._forUpdateOut.cast[nodes.CfgNode]

def jumpArgumentOut: Iterator[nodes.AstNode] = node._jumpArgumentOut.cast[nodes.AstNode]

def postDominateIn: Iterator[nodes.CfgNode] = node._postDominateIn.cast[nodes.CfgNode]

def postDominateOut: Iterator[nodes.CfgNode] = node._postDominateOut.cast[nodes.CfgNode]
Expand Down Expand Up @@ -1333,6 +1343,10 @@ final class AccessNeighborsForControlStructureTraversal(val traversal: Iterator[
*/
def _jumpLabelViaAstOut: Iterator[nodes.JumpLabel] = traversal.flatMap(_._jumpLabelViaAstOut)

/** Traverse to JUMP_LABEL via JUMP_ARGUMENT OUT edge.
*/
def _jumpLabelViaJumpArgumentOut: Iterator[nodes.JumpLabel] = traversal.flatMap(_._jumpLabelViaJumpArgumentOut)

/** Traverse to JUMP_TARGET via AST OUT edge.
*/
def _jumpTargetViaAstOut: Iterator[nodes.JumpTarget] = traversal.flatMap(_._jumpTargetViaAstOut)
Expand Down Expand Up @@ -1453,6 +1467,10 @@ final class AccessNeighborsForControlStructureTraversal(val traversal: Iterator[
*/
def _literalViaForUpdateOut: Iterator[nodes.Literal] = traversal.flatMap(_._literalViaForUpdateOut)

/** Traverse to LITERAL via JUMP_ARGUMENT OUT edge.
*/
def _literalViaJumpArgumentOut: Iterator[nodes.Literal] = traversal.flatMap(_._literalViaJumpArgumentOut)

/** Traverse to LITERAL via POST_DOMINATE IN edge.
*/
def _literalViaPostDominateIn: Iterator[nodes.Literal] = traversal.flatMap(_._literalViaPostDominateIn)
Expand Down Expand Up @@ -1858,6 +1876,8 @@ final class AccessNeighborsForControlStructureTraversal(val traversal: Iterator[

def forUpdateOut: Iterator[nodes.CfgNode] = traversal.flatMap(_.forUpdateOut)

def jumpArgumentOut: Iterator[nodes.AstNode] = traversal.flatMap(_.jumpArgumentOut)

def postDominateIn: Iterator[nodes.CfgNode] = traversal.flatMap(_.postDominateIn)

def postDominateOut: Iterator[nodes.CfgNode] = traversal.flatMap(_.postDominateOut)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ final class AccessNeighborsForJumpLabel(val node: nodes.JumpLabel) extends AnyVa
*/
def _controlStructureViaAstIn: Iterator[nodes.ControlStructure] = astIn.collectAll[nodes.ControlStructure]

/** Traverse to CONTROL_STRUCTURE via JUMP_ARGUMENT IN edge.
*/
def _controlStructureViaJumpArgumentIn: Iterator[nodes.ControlStructure] =
jumpArgumentIn.collectAll[nodes.ControlStructure]

def astIn: Iterator[nodes.ControlStructure] = node._astIn.cast[nodes.ControlStructure]

def jumpArgumentIn: Iterator[nodes.ControlStructure] = node._jumpArgumentIn.cast[nodes.ControlStructure]
}

final class AccessNeighborsForJumpLabelTraversal(val traversal: Iterator[nodes.JumpLabel]) extends AnyVal {
Expand All @@ -18,5 +25,12 @@ final class AccessNeighborsForJumpLabelTraversal(val traversal: Iterator[nodes.J
*/
def _controlStructureViaAstIn: Iterator[nodes.ControlStructure] = traversal.flatMap(_._controlStructureViaAstIn)

/** Traverse to CONTROL_STRUCTURE via JUMP_ARGUMENT IN edge.
*/
def _controlStructureViaJumpArgumentIn: Iterator[nodes.ControlStructure] =
traversal.flatMap(_._controlStructureViaJumpArgumentIn)

def astIn: Iterator[nodes.ControlStructure] = traversal.flatMap(_.astIn)

def jumpArgumentIn: Iterator[nodes.ControlStructure] = traversal.flatMap(_.jumpArgumentIn)
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ final class AccessNeighborsForLiteral(val node: nodes.Literal) extends AnyVal {
*/
def _controlStructureViaForUpdateIn: Iterator[nodes.ControlStructure] = forUpdateIn.collectAll[nodes.ControlStructure]

/** Traverse to CONTROL_STRUCTURE via JUMP_ARGUMENT IN edge.
*/
def _controlStructureViaJumpArgumentIn: Iterator[nodes.ControlStructure] =
jumpArgumentIn.collectAll[nodes.ControlStructure]

/** Traverse to CONTROL_STRUCTURE via POST_DOMINATE IN edge.
*/
def _controlStructureViaPostDominateIn: Iterator[nodes.ControlStructure] =
Expand Down Expand Up @@ -508,6 +513,8 @@ final class AccessNeighborsForLiteral(val node: nodes.Literal) extends AnyVal {

def forUpdateIn: Iterator[nodes.ControlStructure] = node._forUpdateIn.cast[nodes.ControlStructure]

def jumpArgumentIn: Iterator[nodes.ControlStructure] = node._jumpArgumentIn.cast[nodes.ControlStructure]

def postDominateIn: Iterator[nodes.CfgNode] = node._postDominateIn.cast[nodes.CfgNode]

def postDominateOut: Iterator[nodes.CfgNode] = node._postDominateOut.cast[nodes.CfgNode]
Expand Down Expand Up @@ -676,6 +683,11 @@ final class AccessNeighborsForLiteralTraversal(val traversal: Iterator[nodes.Lit
def _controlStructureViaForUpdateIn: Iterator[nodes.ControlStructure] =
traversal.flatMap(_._controlStructureViaForUpdateIn)

/** Traverse to CONTROL_STRUCTURE via JUMP_ARGUMENT IN edge.
*/
def _controlStructureViaJumpArgumentIn: Iterator[nodes.ControlStructure] =
traversal.flatMap(_._controlStructureViaJumpArgumentIn)

/** Traverse to CONTROL_STRUCTURE via POST_DOMINATE IN edge.
*/
def _controlStructureViaPostDominateIn: Iterator[nodes.ControlStructure] =
Expand Down Expand Up @@ -1032,6 +1044,8 @@ final class AccessNeighborsForLiteralTraversal(val traversal: Iterator[nodes.Lit

def forUpdateIn: Iterator[nodes.ControlStructure] = traversal.flatMap(_.forUpdateIn)

def jumpArgumentIn: Iterator[nodes.ControlStructure] = traversal.flatMap(_.jumpArgumentIn)

def postDominateIn: Iterator[nodes.CfgNode] = traversal.flatMap(_.postDominateIn)

def postDominateOut: Iterator[nodes.CfgNode] = traversal.flatMap(_.postDominateOut)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,44 @@ object NewAnnotation {
"TYPE_REF",
"UNKNOWN"
),
"JUMP_ARGUMENT" -> Set(
"ANNOTATION",
"ANNOTATION_LITERAL",
"ANNOTATION_PARAMETER",
"ANNOTATION_PARAMETER_ASSIGN",
"ARRAY_INITIALIZER",
"BLOCK",
"CALL",
"CALL_REPR",
"CFG_NODE",
"COMMENT",
"CONTROL_STRUCTURE",
"EXPRESSION",
"FIELD_IDENTIFIER",
"FILE",
"IDENTIFIER",
"IMPORT",
"JUMP_LABEL",
"JUMP_TARGET",
"LITERAL",
"LOCAL",
"MEMBER",
"METHOD",
"METHOD_PARAMETER_IN",
"METHOD_PARAMETER_OUT",
"METHOD_REF",
"METHOD_RETURN",
"MODIFIER",
"NAMESPACE",
"NAMESPACE_BLOCK",
"RETURN",
"TEMPLATE_DOM",
"TYPE_ARGUMENT",
"TYPE_DECL",
"TYPE_PARAMETER",
"TYPE_REF",
"UNKNOWN"
),
"PARAMETER_LINK" -> Set(
"ANNOTATION",
"ANNOTATION_LITERAL",
Expand Down Expand Up @@ -1615,6 +1653,44 @@ object NewAnnotation {
"TYPE_REF",
"UNKNOWN"
),
"JUMP_ARGUMENT" -> Set(
"ANNOTATION",
"ANNOTATION_LITERAL",
"ANNOTATION_PARAMETER",
"ANNOTATION_PARAMETER_ASSIGN",
"ARRAY_INITIALIZER",
"BLOCK",
"CALL",
"CALL_REPR",
"CFG_NODE",
"COMMENT",
"CONTROL_STRUCTURE",
"EXPRESSION",
"FIELD_IDENTIFIER",
"FILE",
"IDENTIFIER",
"IMPORT",
"JUMP_LABEL",
"JUMP_TARGET",
"LITERAL",
"LOCAL",
"MEMBER",
"METHOD",
"METHOD_PARAMETER_IN",
"METHOD_PARAMETER_OUT",
"METHOD_REF",
"METHOD_RETURN",
"MODIFIER",
"NAMESPACE",
"NAMESPACE_BLOCK",
"RETURN",
"TEMPLATE_DOM",
"TYPE_ARGUMENT",
"TYPE_DECL",
"TYPE_PARAMETER",
"TYPE_REF",
"UNKNOWN"
),
"PARAMETER_LINK" -> Set(
"ANNOTATION",
"ANNOTATION_LITERAL",
Expand Down
Loading
Loading