@@ -80,10 +80,11 @@ predicate isUninterestingForDataFlowModels(Callable api) {
8080predicate isUninterestingForTypeBasedFlowModels ( Callable api ) { none ( ) }
8181
8282/**
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.
8485 *
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.
8788 */
8889class TargetApiSpecific extends Callable {
8990 private Callable lift ;
@@ -97,6 +98,11 @@ class TargetApiSpecific extends Callable {
9798 * Gets the callable that a model will be lifted to.
9899 */
99100 Callable lift ( ) { result = lift }
101+
102+ /**
103+ * Holds if this callable is relevant in terms of generating models.
104+ */
105+ predicate isRelevant ( ) { relevant ( this ) }
100106}
101107
102108private string isExtensible ( Callable c ) {
@@ -114,23 +120,21 @@ private string typeAsModel(Callable c) {
114120 )
115121}
116122
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
119125) {
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 )
126130}
127131
128132/**
129133 * Computes the first 6 columns for MaD rows.
130134 */
131135string asPartialModel ( TargetApiSpecific api ) {
132136 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
134138 result =
135139 type + ";" //
136140 + extensible + ";" //
@@ -145,7 +149,7 @@ string asPartialModel(TargetApiSpecific api) {
145149 */
146150string asPartialNeutralModel ( TargetApiSpecific api ) {
147151 exists ( string type , string name , string parameters |
148- partialLiftedModel ( api , type , _, name , parameters ) and
152+ partialModel ( api , type , _, name , parameters ) and
149153 result =
150154 type + ";" //
151155 + name + ";" //
0 commit comments