@@ -80,10 +80,11 @@ predicate isUninterestingForDataFlowModels(Callable api) {
80
80
predicate isUninterestingForTypeBasedFlowModels ( Callable api ) { none ( ) }
81
81
82
82
/**
83
- * A class of Callables that are relevant for generating summary, source and sinks models for.
83
+ * A class of callables that are potentially relevant for generating summary, source, sink
84
+ * and neutral models.
84
85
*
85
- * In the Standard library and 3rd party libraries it the Callables that can be called
86
- * from outside the library itself.
86
+ * In the Standard library and 3rd party libraries it is the callables (or callables that have a
87
+ * super implementation) that can be called from outside the library itself.
87
88
*/
88
89
class TargetApiSpecific extends Callable {
89
90
private Callable lift ;
@@ -97,6 +98,11 @@ class TargetApiSpecific extends Callable {
97
98
* Gets the callable that a model will be lifted to.
98
99
*/
99
100
Callable lift ( ) { result = lift }
101
+
102
+ /**
103
+ * Holds if this callable is relevant in terms of generating models.
104
+ */
105
+ predicate isRelevant ( ) { relevant ( this ) }
100
106
}
101
107
102
108
private string isExtensible ( Callable c ) {
@@ -114,23 +120,21 @@ private string typeAsModel(Callable c) {
114
120
)
115
121
}
116
122
117
- private predicate partialLiftedModel (
118
- TargetApiSpecific api , string type , string extensible , string name , string parameters
123
+ private predicate partialModel (
124
+ Callable api , string type , string extensible , string name , string parameters
119
125
) {
120
- exists ( Callable c | c = api .lift ( ) |
121
- type = typeAsModel ( c ) and
122
- extensible = isExtensible ( c ) and
123
- name = c .getName ( ) and
124
- parameters = ExternalFlow:: paramsString ( c )
125
- )
126
+ type = typeAsModel ( api ) and
127
+ extensible = isExtensible ( api ) and
128
+ name = api .getName ( ) and
129
+ parameters = ExternalFlow:: paramsString ( api )
126
130
}
127
131
128
132
/**
129
133
* Computes the first 6 columns for MaD rows.
130
134
*/
131
135
string asPartialModel ( TargetApiSpecific api ) {
132
136
exists ( string type , string extensible , string name , string parameters |
133
- partialLiftedModel ( api , type , extensible , name , parameters ) and
137
+ partialModel ( api . lift ( ) , type , extensible , name , parameters ) and
134
138
result =
135
139
type + ";" //
136
140
+ extensible + ";" //
@@ -145,7 +149,7 @@ string asPartialModel(TargetApiSpecific api) {
145
149
*/
146
150
string asPartialNeutralModel ( TargetApiSpecific api ) {
147
151
exists ( string type , string name , string parameters |
148
- partialLiftedModel ( api , type , _, name , parameters ) and
152
+ partialModel ( api , type , _, name , parameters ) and
149
153
result =
150
154
type + ";" //
151
155
+ name + ";" //
0 commit comments