Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
io.shiftleft.codepropertygraph.schema.Dominators.scala Maven / Gradle / Ivy
package io.shiftleft.codepropertygraph.schema
import flatgraph.schema.{SchemaBuilder, SchemaInfo}
object Dominators extends SchemaBase {
def docIndex: Int = 10
override def description: String =
"""
|The Dominators Layer provides dominator- and post-dominator trees for all methods.
|It is constructed automatically from the control flow graph layer and is in turn
|used to automatically construct control dependence relations of the PDG layer.
|""".stripMargin
def apply(builder: SchemaBuilder, methodSchema: Method.Schema, ast: Ast.Schema) =
new Schema(builder, methodSchema, ast)
class Schema(builder: SchemaBuilder, methodSchema: Method.Schema, ast: Ast.Schema) {
implicit private val schemaInfo: SchemaInfo = SchemaInfo.forClass(getClass)
import methodSchema._
import ast._
val dominate = builder
.addEdgeType(
name = "DOMINATE",
comment = "This edge indicates that the source node immediately dominates the destination node."
)
.protoId(181)
val postDominate = builder
.addEdgeType(
name = "POST_DOMINATE",
comment = "This edge indicates that the source node immediately post dominates the destination node."
)
.protoId(182)
method
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = unknown)
methodReturn
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
literal
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
callNode
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
identifier
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
fieldIdentifier
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
ret
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
block
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
unknown
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
controlStructure
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
methodRef
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
typeRef
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = methodReturn)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = method)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = unknown)
jumpTarget
.addOutEdge(edge = dominate, inNode = callNode)
.addOutEdge(edge = dominate, inNode = identifier)
.addOutEdge(edge = dominate, inNode = fieldIdentifier)
.addOutEdge(edge = dominate, inNode = literal)
.addOutEdge(edge = dominate, inNode = ret)
.addOutEdge(edge = dominate, inNode = methodRef)
.addOutEdge(edge = dominate, inNode = typeRef)
.addOutEdge(edge = dominate, inNode = block)
.addOutEdge(edge = dominate, inNode = jumpTarget)
.addOutEdge(edge = dominate, inNode = controlStructure)
.addOutEdge(edge = dominate, inNode = unknown)
.addOutEdge(edge = postDominate, inNode = callNode)
.addOutEdge(edge = postDominate, inNode = identifier)
.addOutEdge(edge = postDominate, inNode = fieldIdentifier)
.addOutEdge(edge = postDominate, inNode = literal)
.addOutEdge(edge = postDominate, inNode = ret)
.addOutEdge(edge = postDominate, inNode = methodRef)
.addOutEdge(edge = postDominate, inNode = typeRef)
.addOutEdge(edge = postDominate, inNode = block)
.addOutEdge(edge = postDominate, inNode = jumpTarget)
.addOutEdge(edge = postDominate, inNode = controlStructure)
.addOutEdge(edge = postDominate, inNode = unknown)
}
}