@@ -35,7 +35,7 @@ module Private {
3535
3636 class Expr = CS:: ControlFlowNodes:: ExprNode ;
3737
38- class VariableUpdate = CS:: Ssa :: ExplicitDefinition ;
38+ class VariableUpdate = CS:: SsaExplicitWrite ;
3939
4040 class Field = CS:: Field ;
4141
@@ -122,37 +122,25 @@ private module Impl {
122122 }
123123
124124 /** Returns the underlying variable update of the explicit SSA variable `v`. */
125- Ssa :: ExplicitDefinition getExplicitSsaAssignment ( Ssa :: ExplicitDefinition v ) { result = v }
125+ SsaExplicitWrite getExplicitSsaAssignment ( SsaExplicitWrite v ) { result = v }
126126
127127 /** Returns the assignment of the variable update `def`. */
128- ExprNode getExprFromSsaAssignment ( Ssa:: ExplicitDefinition def ) {
129- exists ( AssignableDefinition adef |
130- adef = def .getADefinition ( ) and
131- hasChild ( adef .getExpr ( ) , adef .getSource ( ) , def .getControlFlowNode ( ) , result )
132- )
133- or
134- exists ( AssignableDefinitions:: AssignOperationDefinition adef |
135- adef = def .getADefinition ( ) and
136- result .getExpr ( ) = adef .getSource ( )
137- )
138- }
128+ ExprNode getExprFromSsaAssignment ( SsaExplicitWrite def ) { result .getExpr ( ) = def .getValue ( ) }
139129
140130 /** Holds if `def` can have any sign. */
141- predicate explicitSsaDefWithAnySign ( Ssa :: ExplicitDefinition def ) {
142- not exists ( def .getADefinition ( ) . getSource ( ) ) and
143- not def .getElement ( ) instanceof MutatorOperation
131+ predicate explicitSsaDefWithAnySign ( SsaExplicitWrite def ) {
132+ not exists ( def .getValue ( ) ) and
133+ not def .getDefiningExpr ( ) instanceof MutatorOperation
144134 }
145135
146136 /** Returns the operand of the operation if `def` is a decrement. */
147- ExprNode getDecrementOperand ( Ssa:: ExplicitDefinition def ) {
148- hasChild ( def .getElement ( ) , def .getElement ( ) .( DecrementOperation ) .getOperand ( ) ,
149- def .getControlFlowNode ( ) , result )
137+ ExprNode getDecrementOperand ( SsaExplicitWrite def ) {
138+ result .getExpr ( ) = def .getDefiningExpr ( ) .( DecrementOperation ) .getOperand ( )
150139 }
151140
152141 /** Returns the operand of the operation if `def` is an increment. */
153- ExprNode getIncrementOperand ( Ssa:: ExplicitDefinition def ) {
154- hasChild ( def .getElement ( ) , def .getElement ( ) .( IncrementOperation ) .getOperand ( ) ,
155- def .getControlFlowNode ( ) , result )
142+ ExprNode getIncrementOperand ( SsaExplicitWrite def ) {
143+ result .getExpr ( ) = def .getDefiningExpr ( ) .( IncrementOperation ) .getOperand ( )
156144 }
157145
158146 /** Gets the variable underlying the implicit SSA variable `def`. */
0 commit comments