@@ -1350,66 +1350,28 @@ module Make<LocationSig Location, InputSig<Location> Input> {
1350
1350
1351
1351
/** Provides a set of consistency queries. */
1352
1352
module Consistency {
1353
- /** A definition that is relevant for the consistency queries. */
1354
- abstract class RelevantDefinition extends Definition {
1355
- /** Override this predicate to ensure locations in consistency results. */
1356
- abstract predicate hasLocationInfo (
1357
- string filepath , int startline , int startcolumn , int endline , int endcolumn
1358
- ) ;
1359
- }
1360
-
1361
- /** A definition that is relevant for the consistency queries. */
1362
- abstract class RelevantDefinitionExt extends DefinitionExt {
1363
- /** Override this predicate to ensure locations in consistency results. */
1364
- abstract predicate hasLocationInfo (
1365
- string filepath , int startline , int startcolumn , int endline , int endcolumn
1366
- ) ;
1367
- }
1368
-
1369
1353
/** Holds if a read can be reached from multiple definitions. */
1370
- query predicate nonUniqueDef ( RelevantDefinition def , SourceVariable v , BasicBlock bb , int i ) {
1354
+ query predicate nonUniqueDef ( Definition def , SourceVariable v , BasicBlock bb , int i ) {
1371
1355
ssaDefReachesRead ( v , def , bb , i ) and
1372
1356
not exists ( unique( Definition def0 | ssaDefReachesRead ( v , def0 , bb , i ) ) )
1373
1357
}
1374
1358
1375
- /** Holds if a read can be reached from multiple definitions. */
1376
- query predicate nonUniqueDefExt (
1377
- RelevantDefinitionExt def , SourceVariable v , BasicBlock bb , int i
1378
- ) {
1379
- ssaDefReachesReadExt ( v , def , bb , i ) and
1380
- not exists ( unique( DefinitionExt def0 | ssaDefReachesReadExt ( v , def0 , bb , i ) ) )
1381
- }
1382
-
1383
1359
/** Holds if a read cannot be reached from a definition. */
1384
1360
query predicate readWithoutDef ( SourceVariable v , BasicBlock bb , int i ) {
1385
1361
variableRead ( bb , i , v , _) and
1386
1362
not ssaDefReachesRead ( v , _, bb , i )
1387
1363
}
1388
1364
1389
- /** Holds if a read cannot be reached from a definition. */
1390
- query predicate readWithoutDefExt ( SourceVariable v , BasicBlock bb , int i ) {
1391
- variableRead ( bb , i , v , _) and
1392
- not ssaDefReachesReadExt ( v , _, bb , i )
1393
- }
1394
-
1395
1365
/** Holds if a definition cannot reach a read. */
1396
- query predicate deadDef ( RelevantDefinition def , SourceVariable v ) {
1366
+ query predicate deadDef ( Definition def , SourceVariable v ) {
1397
1367
v = def .getSourceVariable ( ) and
1398
1368
not ssaDefReachesRead ( _, def , _, _) and
1399
1369
not phiHasInputFromBlock ( _, def , _) and
1400
1370
not uncertainWriteDefinitionInput ( _, def )
1401
1371
}
1402
1372
1403
- /** Holds if a definition cannot reach a read. */
1404
- query predicate deadDefExt ( RelevantDefinitionExt def , SourceVariable v ) {
1405
- v = def .getSourceVariable ( ) and
1406
- not ssaDefReachesReadExt ( _, def , _, _) and
1407
- not phiHasInputFromBlockExt ( _, def , _) and
1408
- not uncertainWriteDefinitionInput ( _, def )
1409
- }
1410
-
1411
1373
/** Holds if a read is not dominated by a definition. */
1412
- query predicate notDominatedByDef ( RelevantDefinition def , SourceVariable v , BasicBlock bb , int i ) {
1374
+ query predicate notDominatedByDef ( Definition def , SourceVariable v , BasicBlock bb , int i ) {
1413
1375
exists ( BasicBlock bbDef , int iDef | def .definesAt ( v , bbDef , iDef ) |
1414
1376
ssaDefReachesReadWithinBlock ( v , def , bb , i ) and
1415
1377
( bb != bbDef or i < iDef )
@@ -1419,20 +1381,6 @@ module Make<LocationSig Location, InputSig<Location> Input> {
1419
1381
not def .definesAt ( v , getImmediateBasicBlockDominator * ( bb ) , _)
1420
1382
)
1421
1383
}
1422
-
1423
- /** Holds if a read is not dominated by a definition. */
1424
- query predicate notDominatedByDefExt (
1425
- RelevantDefinitionExt def , SourceVariable v , BasicBlock bb , int i
1426
- ) {
1427
- exists ( BasicBlock bbDef , int iDef | def .definesAt ( v , bbDef , iDef , _) |
1428
- ssaDefReachesReadWithinBlock ( v , def , bb , i ) and
1429
- ( bb != bbDef or i < iDef )
1430
- or
1431
- ssaDefReachesReadExt ( v , def , bb , i ) and
1432
- not ssaDefReachesReadWithinBlock ( v , def , bb , i ) and
1433
- not def .definesAt ( v , getImmediateBasicBlockDominator * ( bb ) , _, _)
1434
- )
1435
- }
1436
1384
}
1437
1385
1438
1386
/** Provides the input to `DataFlowIntegration`. */
0 commit comments