@@ -934,27 +934,9 @@ private module Cached {
934
934
TReturnCtxNoFlowThrough ( ) or
935
935
TReturnCtxMaybeFlowThrough ( ReturnPosition pos )
936
936
937
- cached
938
- newtype TTypedContentApprox =
939
- MkTypedContentApprox ( ContentApprox c , DataFlowType t ) {
940
- exists ( Content cont |
941
- c = getContentApprox ( cont ) and
942
- store ( _, cont , _, _, t )
943
- )
944
- }
945
-
946
937
cached
947
938
newtype TTypedContent = MkTypedContent ( Content c , DataFlowType t ) { store ( _, c , _, _, t ) }
948
939
949
- cached
950
- TypedContent getATypedContent ( TypedContentApprox c ) {
951
- exists ( ContentApprox cls , DataFlowType t , Content cont |
952
- c = MkTypedContentApprox ( cls , pragma [ only_bind_into ] ( t ) ) and
953
- result = MkTypedContent ( cont , pragma [ only_bind_into ] ( t ) ) and
954
- cls = getContentApprox ( cont )
955
- )
956
- }
957
-
958
940
cached
959
941
newtype TAccessPathFront =
960
942
TFrontNil ( ) or
@@ -963,7 +945,7 @@ private module Cached {
963
945
cached
964
946
newtype TApproxAccessPathFront =
965
947
TApproxFrontNil ( ) or
966
- TApproxFrontHead ( TypedContentApprox tc )
948
+ TApproxFrontHead ( ContentApprox c )
967
949
968
950
cached
969
951
newtype TAccessPathFrontOption =
@@ -1389,26 +1371,6 @@ class ReturnCtx extends TReturnCtx {
1389
1371
}
1390
1372
}
1391
1373
1392
- /** An approximated `Content` tagged with the type of a containing object. */
1393
- class TypedContentApprox extends MkTypedContentApprox {
1394
- private ContentApprox c ;
1395
- private DataFlowType t ;
1396
-
1397
- TypedContentApprox ( ) { this = MkTypedContentApprox ( c , t ) }
1398
-
1399
- /** Gets a typed content approximated by this value. */
1400
- TypedContent getATypedContent ( ) { result = getATypedContent ( this ) }
1401
-
1402
- /** Gets the content. */
1403
- ContentApprox getContent ( ) { result = c }
1404
-
1405
- /** Gets the container type. */
1406
- DataFlowType getContainerType ( ) { result = t }
1407
-
1408
- /** Gets a textual representation of this approximated content. */
1409
- string toString ( ) { result = c .toString ( ) }
1410
- }
1411
-
1412
1374
/**
1413
1375
* The front of an approximated access path. This is either a head or a nil.
1414
1376
*/
@@ -1417,13 +1379,13 @@ abstract class ApproxAccessPathFront extends TApproxAccessPathFront {
1417
1379
1418
1380
abstract boolean toBoolNonEmpty ( ) ;
1419
1381
1420
- TypedContentApprox getHead ( ) { this = TApproxFrontHead ( result ) }
1382
+ ContentApprox getHead ( ) { this = TApproxFrontHead ( result ) }
1421
1383
1422
1384
pragma [ nomagic]
1423
- TypedContent getAHead ( ) {
1424
- exists ( TypedContentApprox cont |
1385
+ Content getAHead ( ) {
1386
+ exists ( ContentApprox cont |
1425
1387
this = TApproxFrontHead ( cont ) and
1426
- result = cont . getATypedContent ( )
1388
+ cont = getContentApprox ( result )
1427
1389
)
1428
1390
}
1429
1391
}
@@ -1435,11 +1397,11 @@ class ApproxAccessPathFrontNil extends ApproxAccessPathFront, TApproxFrontNil {
1435
1397
}
1436
1398
1437
1399
class ApproxAccessPathFrontHead extends ApproxAccessPathFront , TApproxFrontHead {
1438
- private TypedContentApprox tc ;
1400
+ private ContentApprox c ;
1439
1401
1440
- ApproxAccessPathFrontHead ( ) { this = TApproxFrontHead ( tc ) }
1402
+ ApproxAccessPathFrontHead ( ) { this = TApproxFrontHead ( c ) }
1441
1403
1442
- override string toString ( ) { result = tc .toString ( ) }
1404
+ override string toString ( ) { result = c .toString ( ) }
1443
1405
1444
1406
override boolean toBoolNonEmpty ( ) { result = true }
1445
1407
}
@@ -1501,7 +1463,7 @@ class AccessPathFrontHead extends AccessPathFront, TFrontHead {
1501
1463
1502
1464
override string toString ( ) { result = tc .toString ( ) }
1503
1465
1504
- override ApproxAccessPathFront toApprox ( ) { result .getAHead ( ) = tc }
1466
+ override ApproxAccessPathFront toApprox ( ) { result .getAHead ( ) = tc . getContent ( ) }
1505
1467
}
1506
1468
1507
1469
/** An optional access path front. */
0 commit comments