@@ -1318,7 +1318,7 @@ predicate nodeIsHidden(Node n) {
1318
1318
or
1319
1319
n instanceof InitialGlobalValue
1320
1320
or
1321
- n instanceof SsaPhiInputNode
1321
+ n instanceof SsaSynthNode
1322
1322
}
1323
1323
1324
1324
predicate neverSkipInPathGraph ( Node n ) {
@@ -1632,9 +1632,7 @@ private Instruction getAnInstruction(Node n) {
1632
1632
not n instanceof InstructionNode and
1633
1633
result = n .asOperand ( ) .getUse ( )
1634
1634
or
1635
- result = n .( SsaPhiNode ) .getPhiNode ( ) .getBasicBlock ( ) .getFirstInstruction ( )
1636
- or
1637
- result = n .( SsaPhiInputNode ) .getBasicBlock ( ) .getFirstInstruction ( )
1635
+ result = n .( SsaSynthNode ) .getBasicBlock ( ) .getFirstInstruction ( )
1638
1636
or
1639
1637
n .( IndirectInstruction ) .hasInstructionAndIndirectionIndex ( result , _)
1640
1638
or
@@ -1766,14 +1764,14 @@ module IteratorFlow {
1766
1764
* Note: Unlike `def.getAnUltimateDefinition()` this predicate also
1767
1765
* traverses back through iterator increment and decrement operations.
1768
1766
*/
1769
- private Ssa:: DefinitionExt getAnUltimateDefinition ( Ssa:: DefinitionExt def ) {
1767
+ private Ssa:: Definition getAnUltimateDefinition ( Ssa:: Definition def ) {
1770
1768
result = def .getAnUltimateDefinition ( )
1771
1769
or
1772
1770
exists ( IRBlock bb , int i , IteratorCrementCall crementCall , Ssa:: SourceVariable sv |
1773
1771
crementCall = def .getValue ( ) .asInstruction ( ) .( StoreInstruction ) .getSourceValue ( ) and
1774
1772
sv = def .getSourceVariable ( ) and
1775
1773
bb .getInstruction ( i ) = crementCall and
1776
- Ssa:: ssaDefReachesReadExt ( sv , result , bb , i )
1774
+ Ssa:: ssaDefReachesRead ( sv , result , bb , i )
1777
1775
)
1778
1776
}
1779
1777
@@ -1801,13 +1799,13 @@ module IteratorFlow {
1801
1799
GetsIteratorCall beginCall , Instruction writeToDeref
1802
1800
) {
1803
1801
exists (
1804
- StoreInstruction beginStore , IRBlock bbStar , int iStar , Ssa:: DefinitionExt def ,
1805
- IteratorPointerDereferenceCall starCall , Ssa:: DefinitionExt ultimate , Operand address
1802
+ StoreInstruction beginStore , IRBlock bbStar , int iStar , Ssa:: Definition def ,
1803
+ IteratorPointerDereferenceCall starCall , Ssa:: Definition ultimate , Operand address
1806
1804
|
1807
1805
isIteratorWrite ( writeToDeref , address ) and
1808
1806
operandForFullyConvertedCall ( address , starCall ) and
1809
1807
bbStar .getInstruction ( iStar ) = starCall and
1810
- Ssa:: ssaDefReachesReadExt ( _, def , bbStar , iStar ) and
1808
+ Ssa:: ssaDefReachesRead ( _, def , bbStar , iStar ) and
1811
1809
ultimate = getAnUltimateDefinition * ( def ) and
1812
1810
beginStore = ultimate .getValue ( ) .asInstruction ( ) and
1813
1811
operandForFullyConvertedCall ( beginStore .getSourceValueOperand ( ) , beginCall )
@@ -1836,45 +1834,15 @@ module IteratorFlow {
1836
1834
1837
1835
private module IteratorSsa = SsaImpl:: Make< Location , SsaInput > ;
1838
1836
1839
- cached
1840
- private newtype TSsaDef =
1841
- TDef ( IteratorSsa:: DefinitionExt def ) or
1842
- TPhi ( PhiNode phi )
1843
-
1844
- abstract private class SsaDef extends TSsaDef {
1845
- /** Gets a textual representation of this element. */
1846
- string toString ( ) { none ( ) }
1847
-
1848
- /** Gets the underlying non-phi definition or use. */
1849
- IteratorSsa:: DefinitionExt asDef ( ) { none ( ) }
1850
-
1851
- /** Gets the underlying phi node. */
1852
- PhiNode asPhi ( ) { none ( ) }
1853
-
1854
- /** Gets the location of this element. */
1855
- abstract Location getLocation ( ) ;
1856
- }
1857
-
1858
- private class Def extends TDef , SsaDef {
1859
- IteratorSsa:: DefinitionExt def ;
1860
-
1861
- Def ( ) { this = TDef ( def ) }
1862
-
1863
- final override IteratorSsa:: DefinitionExt asDef ( ) { result = def }
1864
-
1837
+ private class Def extends IteratorSsa:: DefinitionExt {
1865
1838
final override Location getLocation ( ) { result = this .getImpl ( ) .getLocation ( ) }
1866
1839
1867
- /** Gets the variable written to by this definition. */
1868
- final SourceVariable getSourceVariable ( ) { result = def .getSourceVariable ( ) }
1869
-
1870
- override string toString ( ) { result = def .toString ( ) }
1871
-
1872
1840
/**
1873
1841
* Holds if this definition (or use) has index `index` in block `block`,
1874
1842
* and is a definition (or use) of the variable `sv`.
1875
1843
*/
1876
1844
predicate hasIndexInBlock ( IRBlock block , int index , SourceVariable sv ) {
1877
- def .definesAt ( sv , block , index , _)
1845
+ super .definesAt ( sv , block , index , _)
1878
1846
}
1879
1847
1880
1848
private Ssa:: DefImpl getImpl ( ) {
@@ -1891,20 +1859,6 @@ module IteratorFlow {
1891
1859
int getIndirectionIndex ( ) { result = this .getImpl ( ) .getIndirectionIndex ( ) }
1892
1860
}
1893
1861
1894
- private class Phi extends TPhi , SsaDef {
1895
- PhiNode phi ;
1896
-
1897
- Phi ( ) { this = TPhi ( phi ) }
1898
-
1899
- final override PhiNode asPhi ( ) { result = phi }
1900
-
1901
- final override Location getLocation ( ) { result = phi .getBasicBlock ( ) .getLocation ( ) }
1902
-
1903
- override string toString ( ) { result = phi .toString ( ) }
1904
-
1905
- SsaIteratorNode getNode ( ) { result .getIteratorFlowNode ( ) = phi }
1906
- }
1907
-
1908
1862
private class PhiNode extends IteratorSsa:: DefinitionExt {
1909
1863
PhiNode ( ) {
1910
1864
this instanceof IteratorSsa:: PhiNode or
0 commit comments