@@ -74,7 +74,7 @@ signature module Input {
74
74
75
75
// Relating nodes to summaries
76
76
/** Gets a dataflow node respresenting the argument of `call` indicated by `arg`. */
77
- Node argumentOf ( Node call , SummaryComponent arg ) ;
77
+ Node argumentOf ( Node call , SummaryComponent arg , boolean isOutput ) ;
78
78
79
79
/** Gets a dataflow node respresenting the parameter of `callable` indicated by `param`. */
80
80
Node parameterOf ( Node callable , SummaryComponent param ) ;
@@ -224,11 +224,14 @@ module SummaryFlow<Input I> implements Output<I> {
224
224
* as specified by `component`.
225
225
*/
226
226
bindingset [ call, component]
227
- private I:: Node evaluateSummaryComponentLocal ( I:: Node call , I:: SummaryComponent component ) {
228
- result = I:: argumentOf ( call , component )
227
+ private I:: Node evaluateSummaryComponentLocal (
228
+ I:: Node call , I:: SummaryComponent component , boolean isOutput
229
+ ) {
230
+ result = I:: argumentOf ( call , component , isOutput )
229
231
or
230
232
component = I:: return ( ) and
231
- result = call
233
+ result = call and
234
+ isOutput = true
232
235
}
233
236
234
237
/**
@@ -280,27 +283,34 @@ module SummaryFlow<Input I> implements Output<I> {
280
283
*/
281
284
pragma [ nomagic]
282
285
private I:: Node evaluateSummaryComponentStackLocal (
283
- I:: SummarizedCallable callable , I:: Node call , I:: SummaryComponentStack stack
286
+ I:: SummarizedCallable callable , I:: Node call , I:: SummaryComponentStack stack , boolean isOutput
284
287
) {
285
288
exists ( I:: SummaryComponent component |
286
289
dependsOnSummaryComponentStackLeaf ( callable , component ) and
287
290
stack = I:: singleton ( component ) and
288
291
call = I:: callTo ( callable ) and
289
- result = evaluateSummaryComponentLocal ( call , component )
292
+ result = evaluateSummaryComponentLocal ( call , component , isOutput )
290
293
)
291
294
or
292
- exists ( I:: Node prev , I:: SummaryComponent head , I:: SummaryComponentStack tail |
293
- prev = evaluateSummaryComponentStackLocal ( callable , call , tail ) and
295
+ exists (
296
+ I:: Node prev , I:: SummaryComponent head , I:: SummaryComponentStack tail , boolean isOutput0
297
+ |
298
+ prev = evaluateSummaryComponentStackLocal ( callable , call , tail , isOutput0 ) and
294
299
dependsOnSummaryComponentStackConsLocal ( callable , pragma [ only_bind_into ] ( head ) ,
295
300
pragma [ only_bind_out ] ( tail ) ) and
296
301
stack = I:: push ( pragma [ only_bind_out ] ( head ) , pragma [ only_bind_out ] ( tail ) )
297
302
|
298
- result = I:: parameterOf ( prev , head )
303
+ result = I:: parameterOf ( prev , head ) and
304
+ isOutput0 = false and
305
+ isOutput = true
299
306
or
300
- result = I:: returnOf ( prev , head )
307
+ result = I:: returnOf ( prev , head ) and
308
+ isOutput0 = false and
309
+ isOutput = false
301
310
or
302
311
componentLevelStep ( head ) and
303
- result = prev
312
+ result = prev and
313
+ isOutput = isOutput0
304
314
)
305
315
}
306
316
@@ -312,8 +322,8 @@ module SummaryFlow<Input I> implements Output<I> {
312
322
|
313
323
callable .propagatesFlow ( input , output , true ) and
314
324
call = I:: callTo ( callable ) and
315
- nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input ) and
316
- nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output )
325
+ nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input , false ) and
326
+ nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output , true )
317
327
)
318
328
}
319
329
@@ -325,8 +335,8 @@ module SummaryFlow<Input I> implements Output<I> {
325
335
hasLoadSummary ( callable , content , pragma [ only_bind_into ] ( input ) ,
326
336
pragma [ only_bind_into ] ( output ) ) and
327
337
call = I:: callTo ( callable ) and
328
- nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input ) and
329
- nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output )
338
+ nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input , false ) and
339
+ nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output , true )
330
340
)
331
341
}
332
342
@@ -338,8 +348,8 @@ module SummaryFlow<Input I> implements Output<I> {
338
348
hasStoreSummary ( callable , content , pragma [ only_bind_into ] ( input ) ,
339
349
pragma [ only_bind_into ] ( output ) ) and
340
350
call = I:: callTo ( callable ) and
341
- nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input ) and
342
- nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output )
351
+ nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input , false ) and
352
+ nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output , true )
343
353
)
344
354
}
345
355
@@ -354,8 +364,8 @@ module SummaryFlow<Input I> implements Output<I> {
354
364
hasLoadStoreSummary ( callable , loadContent , storeContent , pragma [ only_bind_into ] ( input ) ,
355
365
pragma [ only_bind_into ] ( output ) ) and
356
366
call = I:: callTo ( callable ) and
357
- nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input ) and
358
- nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output )
367
+ nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input , false ) and
368
+ nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output , true )
359
369
)
360
370
}
361
371
@@ -369,8 +379,8 @@ module SummaryFlow<Input I> implements Output<I> {
369
379
hasWithoutContentSummary ( callable , filter , pragma [ only_bind_into ] ( input ) ,
370
380
pragma [ only_bind_into ] ( output ) ) and
371
381
call = I:: callTo ( callable ) and
372
- nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input ) and
373
- nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output )
382
+ nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input , false ) and
383
+ nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output , true )
374
384
)
375
385
}
376
386
@@ -384,8 +394,8 @@ module SummaryFlow<Input I> implements Output<I> {
384
394
hasWithContentSummary ( callable , filter , pragma [ only_bind_into ] ( input ) ,
385
395
pragma [ only_bind_into ] ( output ) ) and
386
396
call = I:: callTo ( callable ) and
387
- nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input ) and
388
- nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output )
397
+ nodeFrom = evaluateSummaryComponentStackLocal ( callable , call , input , false ) and
398
+ nodeTo = evaluateSummaryComponentStackLocal ( callable , call , output , true )
389
399
)
390
400
}
391
401
}
0 commit comments