@@ -150,6 +150,8 @@ module Sem implements Semantic {
150150 }
151151 }
152152
153+ predicate isAssignOp ( BinaryExpr bin ) { bin instanceof AssignOp }
154+
153155 class RelationalExpr = J:: ComparisonExpr ;
154156
155157 abstract class UnaryExpr extends Expr {
@@ -176,18 +178,34 @@ module Sem implements Semantic {
176178 override Expr getOperand ( ) { result = super .getExpr ( ) }
177179 }
178180
179- // TODO: Implement once utils are properly shared
180- class AddOneExpr extends UnaryExpr {
181- AddOneExpr ( ) { none ( ) }
181+ class PreIncExpr extends UnaryExpr instanceof J :: PreIncExpr {
182+ override Expr getOperand ( ) { result = super . getExpr ( ) }
183+ }
182184
183- override Expr getOperand ( ) { none ( ) }
185+ class PreDecExpr extends UnaryExpr instanceof J:: PreDecExpr {
186+ override Expr getOperand ( ) { result = super .getExpr ( ) }
184187 }
185188
186- // TODO: Implement once utils are properly shared
187- class SubOneExpr extends UnaryExpr {
188- SubOneExpr ( ) { none ( ) }
189+ class PostIncExpr extends UnaryExpr instanceof J :: PostIncExpr {
190+ override Expr getOperand ( ) { result = super . getExpr ( ) }
191+ }
189192
190- override Expr getOperand ( ) { none ( ) }
193+ class PostDecExpr extends UnaryExpr instanceof J:: PostDecExpr {
194+ override Expr getOperand ( ) { result = super .getExpr ( ) }
195+ }
196+
197+ class CopyValueExpr extends UnaryExpr {
198+ CopyValueExpr ( ) {
199+ this instanceof J:: PlusExpr or
200+ this instanceof J:: AssignExpr or
201+ this instanceof LocalVariableDeclExpr
202+ }
203+
204+ override Expr getOperand ( ) {
205+ result = this .( J:: PlusExpr ) .getExpr ( ) or
206+ result = this .( J:: AssignExpr ) .getSource ( ) or
207+ result = this .( J:: LocalVariableDeclExpr ) .getInit ( )
208+ }
191209 }
192210
193211 class ConditionalExpr = J:: ConditionalExpr ;
@@ -228,7 +246,9 @@ module Sem implements Semantic {
228246
229247 class SsaPhiNode extends SsaVariable instanceof SSA:: SsaPhiNode { }
230248
231- class SsaExplicitUpdate extends SsaVariable instanceof SSA:: SsaExplicitUpdate { }
249+ class SsaExplicitUpdate extends SsaVariable instanceof SSA:: SsaExplicitUpdate {
250+ Expr getDefiningExpr ( ) { result = super .getDefiningExpr ( ) }
251+ }
232252
233253 final private class FinalSsaReadPosition = SsaReadPos:: SsaReadPosition ;
234254
0 commit comments