Merge pull request #15371 from geoffw0/mad

C++: Implement models-as-data
This commit is contained in:
Mathias Vorreiter Pedersen
2024-04-16 14:33:12 +01:00
committed by GitHub
44 changed files with 2737 additions and 222 deletions

View File

@@ -46,7 +46,6 @@
* The arguments are zero-indexed, and `-1` specifies the qualifier.
* - "Argument[n1..n2]": Similar to "Argument[n]" but select any argument in
* the given range. The range is inclusive at both ends.
* - "Parameter": Selects the value of a parameter of the selected element.
* - "Parameter[n]": Similar to "Parameter" but restricted to a specific
* numbered parameter (zero-indexed, and `-1` specifies the value of `this`).
* - "Parameter[n1..n2]": Similar to "Parameter[n]" but selects any parameter

View File

@@ -323,7 +323,9 @@ private module Cached {
/** This is the local flow predicate that is exposed. */
cached
predicate localFlowStepImpl(Node nodeFrom, Node nodeTo) {
localFlowStepCommon(nodeFrom, nodeTo, _) or
localFlowStepCommon(nodeFrom, nodeTo, _)
or
// models-as-data summarized flow
FlowSummaryImpl::Private::Steps::summaryThroughStepValue(nodeFrom, nodeTo, _)
}
@@ -1027,6 +1029,7 @@ predicate captureValueStep(Node node1, Node node2) {
}
predicate jumpStep(Node pred, Node succ) {
// models-as-data summarized flow
FlowSummaryImpl::Private::Steps::summaryJumpStep(pred.(FlowSummaryNode).getSummaryNode(),
succ.(FlowSummaryNode).getSummaryNode())
}
@@ -1136,6 +1139,7 @@ predicate storeStep(Node node1, ContentSet c, Node node2) {
c.isSingleton(any(Content::CollectionContent cc))
)
or
// models-as-data summarized flow
FlowSummaryImpl::Private::Steps::summaryStoreStep(node1.(FlowSummaryNode).getSummaryNode(), c,
node2.(FlowSummaryNode).getSummaryNode())
or
@@ -1241,6 +1245,7 @@ predicate readStep(Node node1, ContentSet c, Node node2) {
c instanceof OptionalSomeContentSet
)
or
// models-as-data summarized flow
FlowSummaryImpl::Private::Steps::summaryReadStep(node1.(FlowSummaryNode).getSummaryNode(), c,
node2.(FlowSummaryNode).getSummaryNode())
or

View File

@@ -209,10 +209,6 @@ module SourceSinkInterpretationInput implements
ast = mid.asElement() and
e.getMember() = ast
|
// Allow fields to be picked as input nodes.
c = "" and
e.getBase() = n.asExpr()
or
// Allow post update nodes to be picked as input nodes when the `input` column
// of the row is `PostUpdate`.
c = "PostUpdate" and