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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ object PropertyNames {
*/
val ClosureBindingId: String = "CLOSURE_BINDING_ID"

/** Deprecated. Create an explict REF edge instead. Formerly the original name of the (potentially mangled) captured
* variable
*/
val ClosureOriginalName: String = "CLOSURE_ORIGINAL_NAME"

/** This field holds the code snippet that the node represents. */
val Code: String = "CODE"

Expand Down Expand Up @@ -295,7 +290,6 @@ object PropertyNames {
AstParentType,
CanonicalName,
ClosureBindingId,
ClosureOriginalName,
Code,
ColumnNumber,
ColumnNumberEnd,
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ trait HasCanonicalNameEMT
*/
trait HasClosureBindingIdEMT

/** Node types with this marker trait are guaranteed to have the CLOSURE_ORIGINAL_NAME property. EMT stands for: "erased
* marker trait", it exists only at compile time in order to improve type safety.
*/
trait HasClosureOriginalNameEMT

/** Node types with this marker trait are guaranteed to have the CODE property. EMT stands for: "erased marker trait",
* it exists only at compile time in order to improve type safety.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@ import scala.collection.mutable
/** Node base type for compiletime-only checks to improve type safety. EMT stands for: "erased marker trait", i.e. it is
* erased at runtime
*/
trait ClosureBindingEMT
extends AnyRef
with HasClosureBindingIdEMT
with HasClosureOriginalNameEMT
with HasEvaluationStrategyEMT
trait ClosureBindingEMT extends AnyRef with HasClosureBindingIdEMT with HasEvaluationStrategyEMT

trait ClosureBindingBase extends AbstractNode with StaticType[ClosureBindingEMT] {

override def propertiesMap: java.util.Map[String, Any] = {
import io.shiftleft.codepropertygraph.generated.accessors.languagebootstrap.*
val res = new java.util.HashMap[String, Any]()
this.closureBindingId.foreach { p => res.put("CLOSURE_BINDING_ID", p) }
this.closureOriginalName.foreach { p => res.put("CLOSURE_ORIGINAL_NAME", p) }
if (("<empty>": String) != this.evaluationStrategy) res.put("EVALUATION_STRATEGY", this.evaluationStrategy)
res
}
Expand All @@ -34,9 +29,6 @@ object ClosureBinding {
* ▸ ClosureBindingId (String); Cardinality `ZeroOrOne` (optional); Identifier which uniquely describes a
* CLOSURE_BINDING. This property is used to match captured LOCAL nodes with the corresponding CLOSURE_BINDING nodes
*
* ▸ ClosureOriginalName (String); Cardinality `ZeroOrOne` (optional); Deprecated. Create an explict REF edge instead.
* Formerly the original name of the (potentially mangled) captured variable
*
* ▸ EvaluationStrategy (String); Cardinality `one` (mandatory with default value `<empty>`); For formal method input
* parameters, output parameters, and return parameters, this field holds the evaluation strategy, which is one of the
* following: 1) `BY_REFERENCE` indicates that the parameter is passed by reference, 2) `BY_VALUE` indicates that it is
Expand All @@ -51,21 +43,19 @@ class ClosureBinding(graph_4762: flatgraph.Graph, seq_4762: Int)
override def productElementName(n: Int): String =
n match {
case 0 => "closureBindingId"
case 1 => "closureOriginalName"
case 2 => "evaluationStrategy"
case 1 => "evaluationStrategy"
case _ => ""
}

override def productElement(n: Int): Any =
n match {
case 0 => this.closureBindingId
case 1 => this.closureOriginalName
case 2 => this.evaluationStrategy
case 1 => this.evaluationStrategy
case _ => null
}

override def productPrefix = "ClosureBinding"
override def productArity = 3
override def productArity = 2

override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[ClosureBinding]
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class Finding(graph_4762: flatgraph.Graph, seq_4762: Int)
with FindingBase
with StaticType[FindingEMT] {
def evidence: IndexedSeq[StoredNode] =
flatgraph.Accessors.getNodePropertyMulti[StoredNode](graph, nodeKind = nodeKind, propertyKind = 51, seq = seq)
flatgraph.Accessors.getNodePropertyMulti[StoredNode](graph, nodeKind = nodeKind, propertyKind = 50, seq = seq)
def keyValuePairs: IndexedSeq[KeyValuePair] =
flatgraph.Accessors.getNodePropertyMulti[KeyValuePair](graph, nodeKind = nodeKind, propertyKind = 52, seq = seq)
flatgraph.Accessors.getNodePropertyMulti[KeyValuePair](graph, nodeKind = nodeKind, propertyKind = 51, seq = seq)

override def productElementName(n: Int): String =
n match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1553,14 +1553,14 @@ class NewAnnotation extends NewNode(nodeKind = 0) with AnnotationBase with Expre
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 1, 1)
interface.countProperty(this, 2, argumentName.size)
interface.countProperty(this, 8, 1)
interface.countProperty(this, 9, columnNumber.size)
interface.countProperty(this, 21, 1)
interface.countProperty(this, 34, lineNumber.size)
interface.countProperty(this, 38, 1)
interface.countProperty(this, 39, offset.size)
interface.countProperty(this, 40, offsetEnd.size)
interface.countProperty(this, 41, 1)
interface.countProperty(this, 7, 1)
interface.countProperty(this, 8, columnNumber.size)
interface.countProperty(this, 20, 1)
interface.countProperty(this, 33, lineNumber.size)
interface.countProperty(this, 37, 1)
interface.countProperty(this, 38, offset.size)
interface.countProperty(this, 39, offsetEnd.size)
interface.countProperty(this, 40, 1)
}

override def copy: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1526,13 +1526,13 @@ class NewAnnotationLiteral extends NewNode(nodeKind = 1) with AnnotationLiteralB
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 1, 1)
interface.countProperty(this, 2, argumentName.size)
interface.countProperty(this, 8, 1)
interface.countProperty(this, 9, columnNumber.size)
interface.countProperty(this, 34, lineNumber.size)
interface.countProperty(this, 38, 1)
interface.countProperty(this, 39, offset.size)
interface.countProperty(this, 40, offsetEnd.size)
interface.countProperty(this, 41, 1)
interface.countProperty(this, 7, 1)
interface.countProperty(this, 8, columnNumber.size)
interface.countProperty(this, 33, lineNumber.size)
interface.countProperty(this, 37, 1)
interface.countProperty(this, 38, offset.size)
interface.countProperty(this, 39, offsetEnd.size)
interface.countProperty(this, 40, 1)
}

override def copy: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1438,12 +1438,12 @@ class NewAnnotationParameter extends NewNode(nodeKind = 2) with AnnotationParame
def offsetEnd(value: Option[Int]): this.type = { this.offsetEnd = value; this }
def order(value: Int): this.type = { this.order = value; this }
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 8, 1)
interface.countProperty(this, 9, columnNumber.size)
interface.countProperty(this, 34, lineNumber.size)
interface.countProperty(this, 39, offset.size)
interface.countProperty(this, 40, offsetEnd.size)
interface.countProperty(this, 41, 1)
interface.countProperty(this, 7, 1)
interface.countProperty(this, 8, columnNumber.size)
interface.countProperty(this, 33, lineNumber.size)
interface.countProperty(this, 38, offset.size)
interface.countProperty(this, 39, offsetEnd.size)
interface.countProperty(this, 40, 1)
}

override def copy: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1438,12 +1438,12 @@ class NewAnnotationParameterAssign extends NewNode(nodeKind = 3) with Annotation
def offsetEnd(value: Option[Int]): this.type = { this.offsetEnd = value; this }
def order(value: Int): this.type = { this.order = value; this }
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 8, 1)
interface.countProperty(this, 9, columnNumber.size)
interface.countProperty(this, 34, lineNumber.size)
interface.countProperty(this, 39, offset.size)
interface.countProperty(this, 40, offsetEnd.size)
interface.countProperty(this, 41, 1)
interface.countProperty(this, 7, 1)
interface.countProperty(this, 8, columnNumber.size)
interface.countProperty(this, 33, lineNumber.size)
interface.countProperty(this, 38, offset.size)
interface.countProperty(this, 39, offsetEnd.size)
interface.countProperty(this, 40, 1)
}

override def copy: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1499,12 +1499,12 @@ class NewArrayInitializer extends NewNode(nodeKind = 4) with ArrayInitializerBas
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 1, 1)
interface.countProperty(this, 2, argumentName.size)
interface.countProperty(this, 8, 1)
interface.countProperty(this, 9, columnNumber.size)
interface.countProperty(this, 34, lineNumber.size)
interface.countProperty(this, 39, offset.size)
interface.countProperty(this, 40, offsetEnd.size)
interface.countProperty(this, 41, 1)
interface.countProperty(this, 7, 1)
interface.countProperty(this, 8, columnNumber.size)
interface.countProperty(this, 33, lineNumber.size)
interface.countProperty(this, 38, offset.size)
interface.countProperty(this, 39, offsetEnd.size)
interface.countProperty(this, 40, 1)
}

override def copy: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ class NewBinding extends NewNode(nodeKind = 5) with BindingBase {
def name(value: String): this.type = { this.name = value; this }
def signature(value: String): this.type = { this.signature = value; this }
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 36, 1)
interface.countProperty(this, 38, 1)
interface.countProperty(this, 46, 1)
interface.countProperty(this, 35, 1)
interface.countProperty(this, 37, 1)
interface.countProperty(this, 45, 1)
}

override def copy: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1586,15 +1586,15 @@ class NewBlock extends NewNode(nodeKind = 6) with BlockBase with ExpressionNew {
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 1, 1)
interface.countProperty(this, 2, argumentName.size)
interface.countProperty(this, 8, 1)
interface.countProperty(this, 9, columnNumber.size)
interface.countProperty(this, 16, dynamicTypeHintFullName.size)
interface.countProperty(this, 34, lineNumber.size)
interface.countProperty(this, 39, offset.size)
interface.countProperty(this, 40, offsetEnd.size)
interface.countProperty(this, 41, 1)
interface.countProperty(this, 44, possibleTypes.size)
interface.countProperty(this, 48, 1)
interface.countProperty(this, 7, 1)
interface.countProperty(this, 8, columnNumber.size)
interface.countProperty(this, 15, dynamicTypeHintFullName.size)
interface.countProperty(this, 33, lineNumber.size)
interface.countProperty(this, 38, offset.size)
interface.countProperty(this, 39, offsetEnd.size)
interface.countProperty(this, 40, 1)
interface.countProperty(this, 43, possibleTypes.size)
interface.countProperty(this, 47, 1)
}

override def copy: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1694,19 +1694,19 @@ class NewCall extends NewNode(nodeKind = 7) with CallBase with CallReprNew with
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 1, 1)
interface.countProperty(this, 2, argumentName.size)
interface.countProperty(this, 8, 1)
interface.countProperty(this, 9, columnNumber.size)
interface.countProperty(this, 15, 1)
interface.countProperty(this, 16, dynamicTypeHintFullName.size)
interface.countProperty(this, 34, lineNumber.size)
interface.countProperty(this, 36, 1)
interface.countProperty(this, 38, 1)
interface.countProperty(this, 39, offset.size)
interface.countProperty(this, 40, offsetEnd.size)
interface.countProperty(this, 41, 1)
interface.countProperty(this, 44, possibleTypes.size)
interface.countProperty(this, 46, 1)
interface.countProperty(this, 48, 1)
interface.countProperty(this, 7, 1)
interface.countProperty(this, 8, columnNumber.size)
interface.countProperty(this, 14, 1)
interface.countProperty(this, 15, dynamicTypeHintFullName.size)
interface.countProperty(this, 33, lineNumber.size)
interface.countProperty(this, 35, 1)
interface.countProperty(this, 37, 1)
interface.countProperty(this, 38, offset.size)
interface.countProperty(this, 39, offsetEnd.size)
interface.countProperty(this, 40, 1)
interface.countProperty(this, 43, possibleTypes.size)
interface.countProperty(this, 45, 1)
interface.countProperty(this, 47, 1)
}

override def copy: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,6 @@ object NewClosureBinding {
}
}
}
object NewNodeInserter_ClosureBinding_closureOriginalName extends flatgraph.NewNodePropertyInsertionHelper {
override def insertNewNodeProperties(
newNodes: mutable.ArrayBuffer[flatgraph.DNode],
dst: AnyRef,
offsets: Array[Int]
): Unit = {
if (newNodes.isEmpty) return
val dstCast = dst.asInstanceOf[Array[String]]
val seq = newNodes.head.storedRef.get.seq()
var offset = offsets(seq)
var idx = 0
while (idx < newNodes.length) {
val nn = newNodes(idx)
nn match {
case generated: NewClosureBinding =>
generated.closureOriginalName match {
case Some(item) =>
dstCast(offset) = item
offset += 1
case _ =>
}
case _ =>
}
assert(seq + idx == nn.storedRef.get.seq(), "internal consistency check")
idx += 1
offsets(idx + seq) = offset
}
}
}
object NewNodeInserter_ClosureBinding_evaluationStrategy extends flatgraph.NewNodePropertyInsertionHelper {
override def insertNewNodeProperties(
newNodes: mutable.ArrayBuffer[flatgraph.DNode],
Expand Down Expand Up @@ -108,45 +79,38 @@ class NewClosureBinding extends NewNode(nodeKind = 8) with ClosureBindingBase {
NewClosureBinding.inNeighbors.getOrElse(edgeLabel, Set.empty).contains(n.label)
}

var closureBindingId: Option[String] = None
var closureOriginalName: Option[String] = None
var evaluationStrategy: String = "<empty>": String
def closureBindingId(value: Option[String]): this.type = { this.closureBindingId = value; this }
def closureBindingId(value: String): this.type = { this.closureBindingId = Option(value); this }
def closureOriginalName(value: Option[String]): this.type = { this.closureOriginalName = value; this }
def closureOriginalName(value: String): this.type = { this.closureOriginalName = Option(value); this }
def evaluationStrategy(value: String): this.type = { this.evaluationStrategy = value; this }
var closureBindingId: Option[String] = None
var evaluationStrategy: String = "<empty>": String
def closureBindingId(value: Option[String]): this.type = { this.closureBindingId = value; this }
def closureBindingId(value: String): this.type = { this.closureBindingId = Option(value); this }
def evaluationStrategy(value: String): this.type = { this.evaluationStrategy = value; this }
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 6, closureBindingId.size)
interface.countProperty(this, 7, closureOriginalName.size)
interface.countProperty(this, 17, 1)
interface.countProperty(this, 16, 1)
}

override def copy: this.type = {
val newInstance = new NewClosureBinding
newInstance.closureBindingId = this.closureBindingId
newInstance.closureOriginalName = this.closureOriginalName
newInstance.evaluationStrategy = this.evaluationStrategy
newInstance.asInstanceOf[this.type]
}

override def productElementName(n: Int): String =
n match {
case 0 => "closureBindingId"
case 1 => "closureOriginalName"
case 2 => "evaluationStrategy"
case 1 => "evaluationStrategy"
case _ => ""
}

override def productElement(n: Int): Any =
n match {
case 0 => this.closureBindingId
case 1 => this.closureOriginalName
case 2 => this.evaluationStrategy
case 1 => this.evaluationStrategy
case _ => null
}

override def productPrefix = "NewClosureBinding"
override def productArity = 3
override def productArity = 2
override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[NewClosureBinding]
}
Original file line number Diff line number Diff line change
Expand Up @@ -1465,13 +1465,13 @@ class NewComment extends NewNode(nodeKind = 9) with CommentBase with AstNodeNew
def offsetEnd(value: Option[Int]): this.type = { this.offsetEnd = value; this }
def order(value: Int): this.type = { this.order = value; this }
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 8, 1)
interface.countProperty(this, 9, columnNumber.size)
interface.countProperty(this, 20, 1)
interface.countProperty(this, 34, lineNumber.size)
interface.countProperty(this, 39, offset.size)
interface.countProperty(this, 40, offsetEnd.size)
interface.countProperty(this, 41, 1)
interface.countProperty(this, 7, 1)
interface.countProperty(this, 8, columnNumber.size)
interface.countProperty(this, 19, 1)
interface.countProperty(this, 33, lineNumber.size)
interface.countProperty(this, 38, offset.size)
interface.countProperty(this, 39, offsetEnd.size)
interface.countProperty(this, 40, 1)
}

override def copy: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class NewConfigFile extends NewNode(nodeKind = 10) with ConfigFileBase {
def content(value: String): this.type = { this.content = value; this }
def name(value: String): this.type = { this.name = value; this }
override def countAndVisitProperties(interface: flatgraph.BatchedUpdateInterface): Unit = {
interface.countProperty(this, 12, 1)
interface.countProperty(this, 38, 1)
interface.countProperty(this, 11, 1)
interface.countProperty(this, 37, 1)
}

override def copy: this.type = {
Expand Down
Loading