@@ -934,27 +934,9 @@ private module Cached {
934934 TReturnCtxNoFlowThrough ( ) or
935935 TReturnCtxMaybeFlowThrough ( ReturnPosition pos )
936936
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-
946937 cached
947938 newtype TTypedContent = MkTypedContent ( Content c , DataFlowType t ) { store ( _, c , _, _, t ) }
948939
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-
958940 cached
959941 newtype TAccessPathFront =
960942 TFrontNil ( ) or
@@ -963,7 +945,7 @@ private module Cached {
963945 cached
964946 newtype TApproxAccessPathFront =
965947 TApproxFrontNil ( ) or
966- TApproxFrontHead ( TypedContentApprox tc )
948+ TApproxFrontHead ( ContentApprox c )
967949
968950 cached
969951 newtype TAccessPathFrontOption =
@@ -1389,26 +1371,6 @@ class ReturnCtx extends TReturnCtx {
13891371 }
13901372}
13911373
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-
14121374/**
14131375 * The front of an approximated access path. This is either a head or a nil.
14141376 */
@@ -1417,13 +1379,13 @@ abstract class ApproxAccessPathFront extends TApproxAccessPathFront {
14171379
14181380 abstract boolean toBoolNonEmpty ( ) ;
14191381
1420- TypedContentApprox getHead ( ) { this = TApproxFrontHead ( result ) }
1382+ ContentApprox getHead ( ) { this = TApproxFrontHead ( result ) }
14211383
14221384 pragma [ nomagic]
1423- TypedContent getAHead ( ) {
1424- exists ( TypedContentApprox cont |
1385+ Content getAHead ( ) {
1386+ exists ( ContentApprox cont |
14251387 this = TApproxFrontHead ( cont ) and
1426- result = cont . getATypedContent ( )
1388+ cont = getContentApprox ( result )
14271389 )
14281390 }
14291391}
@@ -1435,11 +1397,11 @@ class ApproxAccessPathFrontNil extends ApproxAccessPathFront, TApproxFrontNil {
14351397}
14361398
14371399class ApproxAccessPathFrontHead extends ApproxAccessPathFront , TApproxFrontHead {
1438- private TypedContentApprox tc ;
1400+ private ContentApprox c ;
14391401
1440- ApproxAccessPathFrontHead ( ) { this = TApproxFrontHead ( tc ) }
1402+ ApproxAccessPathFrontHead ( ) { this = TApproxFrontHead ( c ) }
14411403
1442- override string toString ( ) { result = tc .toString ( ) }
1404+ override string toString ( ) { result = c .toString ( ) }
14431405
14441406 override boolean toBoolNonEmpty ( ) { result = true }
14451407}
@@ -1501,7 +1463,7 @@ class AccessPathFrontHead extends AccessPathFront, TFrontHead {
15011463
15021464 override string toString ( ) { result = tc .toString ( ) }
15031465
1504- override ApproxAccessPathFront toApprox ( ) { result .getAHead ( ) = tc }
1466+ override ApproxAccessPathFront toApprox ( ) { result .getAHead ( ) = tc . getContent ( ) }
15051467}
15061468
15071469/** An optional access path front. */
0 commit comments