Skip to content

Commit 4afdb09

Browse files
committed
Dataflow: Remove src/sink grouping feature.
1 parent ae013ba commit 4afdb09

File tree

3 files changed

+15
-94
lines changed

3 files changed

+15
-94
lines changed

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl1.qll

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,6 @@ deprecated private module Config implements FullStateConfigSig {
290290

291291
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }
292292

293-
predicate sourceGrouping(Node source, string sourceGroup) {
294-
any(Configuration config).sourceGrouping(source, sourceGroup)
295-
}
296-
297-
predicate sinkGrouping(Node sink, string sinkGroup) {
298-
any(Configuration config).sinkGrouping(sink, sinkGroup)
299-
}
300-
301293
predicate includeHiddenNodes() { any(Configuration config).includeHiddenNodes() }
302294
}
303295

shared/dataflow/codeql/dataflow/DataFlow.qll

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,6 @@ module Configs<LocationSig Location, InputSig<Location> Lang> {
424424
*/
425425
default FlowFeature getAFeature() { none() }
426426

427-
/** Holds if sources should be grouped in the result of `flowPath`. */
428-
default predicate sourceGrouping(Node source, string sourceGroup) { none() }
429-
430-
/** Holds if sinks should be grouped in the result of `flowPath`. */
431-
default predicate sinkGrouping(Node sink, string sinkGroup) { none() }
432-
433427
/**
434428
* Holds if hidden nodes should be included in the data flow graph.
435429
*
@@ -546,12 +540,6 @@ module Configs<LocationSig Location, InputSig<Location> Lang> {
546540
*/
547541
default FlowFeature getAFeature() { none() }
548542

549-
/** Holds if sources should be grouped in the result of `flowPath`. */
550-
default predicate sourceGrouping(Node source, string sourceGroup) { none() }
551-
552-
/** Holds if sinks should be grouped in the result of `flowPath`. */
553-
default predicate sinkGrouping(Node sink, string sinkGroup) { none() }
554-
555543
/**
556544
* Holds if hidden nodes should be included in the data flow graph.
557545
*

shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll

Lines changed: 15 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
117117
*/
118118
FlowFeature getAFeature();
119119

120-
/** Holds if sources should be grouped in the result of `flowPath`. */
121-
predicate sourceGrouping(Node source, string sourceGroup);
122-
123-
/** Holds if sinks should be grouped in the result of `flowPath`. */
124-
predicate sinkGrouping(Node sink, string sinkGroup);
125-
126120
/**
127121
* Holds if hidden nodes should be included in the data flow graph.
128122
*
@@ -3934,12 +3928,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
39343928
node = sink.getNodeEx() and
39353929
state = sink.getState()
39363930
)
3937-
} or
3938-
TPathNodeSourceGroup(string sourceGroup) {
3939-
exists(PathNodeImpl source | sourceGroup = source.getSourceGroup())
3940-
} or
3941-
TPathNodeSinkGroup(string sinkGroup) {
3942-
exists(PathNodeSink sink | sinkGroup = sink.getSinkGroup())
39433931
}
39443932

39453933
/**
@@ -4153,21 +4141,9 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
41534141
)
41544142
}
41554143

4156-
string getSourceGroup() {
4157-
this.isSource(_) and
4158-
Config::sourceGrouping(this.getNodeEx().asNode(), result)
4159-
}
4160-
4161-
predicate isFlowSource() {
4162-
this.isSource(_) and not exists(this.getSourceGroup())
4163-
or
4164-
this instanceof PathNodeSourceGroup
4165-
}
4144+
predicate isFlowSource() { this.isSource(_) }
41664145

4167-
predicate isFlowSink() {
4168-
this = any(PathNodeSink sink | not exists(sink.getSinkGroup())) or
4169-
this instanceof PathNodeSinkGroup
4170-
}
4146+
predicate isFlowSink() { this instanceof PathNodeSink }
41714147

41724148
private string ppType() {
41734149
this instanceof PathNodeSink and result = ""
@@ -4217,7 +4193,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
42174193
/** Holds if `n` can reach a sink. */
42184194
private predicate directReach(PathNodeImpl n) {
42194195
n instanceof PathNodeSink or
4220-
n instanceof PathNodeSinkGroup or
42214196
directReach(n.getANonHiddenSuccessor(_))
42224197
}
42234198

@@ -4284,11 +4259,19 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
42844259
/** Holds if this node is a source. */
42854260
final predicate isSource() { super.isSource(_) }
42864261

4287-
/** Holds if this node is a grouping of source nodes. */
4288-
final predicate isSourceGroup(string group) { this = TPathNodeSourceGroup(group) }
4262+
/**
4263+
* DEPRECATED: This functionality is no longer available.
4264+
*
4265+
* Holds if this node is a grouping of source nodes.
4266+
*/
4267+
deprecated final predicate isSourceGroup(string group) { none() }
42894268

4290-
/** Holds if this node is a grouping of sink nodes. */
4291-
final predicate isSinkGroup(string group) { this = TPathNodeSinkGroup(group) }
4269+
/**
4270+
* DEPRECATED: This functionality is no longer available.
4271+
*
4272+
* Holds if this node is a grouping of sink nodes.
4273+
*/
4274+
deprecated final predicate isSinkGroup(string group) { none() }
42924275
}
42934276

42944277
/**
@@ -4436,53 +4419,11 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
44364419

44374420
override FlowState getState() { result = state }
44384421

4439-
override PathNodeImpl getASuccessorImpl(string label) {
4440-
result = TPathNodeSinkGroup(this.getSinkGroup()) and label = ""
4441-
}
4422+
override PathNodeImpl getASuccessorImpl(string label) { none() }
44424423

44434424
override predicate isSource(string model) {
44444425
sourceNode(node, state) and sourceModel(node, model)
44454426
}
4446-
4447-
string getSinkGroup() { Config::sinkGrouping(node.asNode(), result) }
4448-
}
4449-
4450-
private class PathNodeSourceGroup extends PathNodeImpl, TPathNodeSourceGroup {
4451-
string sourceGroup;
4452-
4453-
PathNodeSourceGroup() { this = TPathNodeSourceGroup(sourceGroup) }
4454-
4455-
override NodeEx getNodeEx() { none() }
4456-
4457-
override FlowState getState() { none() }
4458-
4459-
override PathNodeImpl getASuccessorImpl(string label) {
4460-
result.getSourceGroup() = sourceGroup and label = ""
4461-
}
4462-
4463-
override predicate isSource(string model) { none() }
4464-
4465-
override string toString() { result = sourceGroup }
4466-
4467-
override Location getLocation() { result.hasLocationInfo("", 0, 0, 0, 0) }
4468-
}
4469-
4470-
private class PathNodeSinkGroup extends PathNodeImpl, TPathNodeSinkGroup {
4471-
string sinkGroup;
4472-
4473-
PathNodeSinkGroup() { this = TPathNodeSinkGroup(sinkGroup) }
4474-
4475-
override NodeEx getNodeEx() { none() }
4476-
4477-
override FlowState getState() { none() }
4478-
4479-
override PathNodeImpl getASuccessorImpl(string label) { none() }
4480-
4481-
override predicate isSource(string model) { none() }
4482-
4483-
override string toString() { result = sinkGroup }
4484-
4485-
override Location getLocation() { result.hasLocationInfo("", 0, 0, 0, 0) }
44864427
}
44874428

44884429
private predicate pathNode(

0 commit comments

Comments
 (0)