@@ -256,23 +256,29 @@ private predicate sourceVariableHasBaseAndIndex(SourceVariable v, BaseSourceVari
256
256
}
257
257
258
258
abstract class DefImpl extends DefOrUseImpl {
259
- Operand address ;
260
259
int ind ;
261
260
262
261
bindingset [ ind]
263
262
DefImpl ( ) { any ( ) }
264
263
265
- abstract int getIndirection ( ) ;
264
+ override int getIndirectionIndex ( ) { result = ind }
266
265
267
- abstract Node0Impl getValue ( ) ;
266
+ override string toString ( ) { result = "Def of " + this .getSourceVariable ( ) }
267
+
268
+ abstract int getIndirection ( ) ;
268
269
269
270
abstract predicate isCertain ( ) ;
270
271
271
- Operand getAddressOperand ( ) { result = address }
272
+ abstract Node0Impl getValue ( ) ;
273
+ }
272
274
273
- override int getIndirectionIndex ( ) { result = ind }
275
+ abstract class OperandBasedDef extends DefImpl {
276
+ Operand address ;
274
277
275
- override string toString ( ) { result = "Def of " + this .getSourceVariable ( ) }
278
+ bindingset [ ind]
279
+ OperandBasedDef ( ) { any ( ) }
280
+
281
+ Operand getAddressOperand ( ) { result = address }
276
282
277
283
override Cpp:: Location getLocation ( ) { result = this .getAddressOperand ( ) .getUse ( ) .getLocation ( ) }
278
284
@@ -281,7 +287,7 @@ abstract class DefImpl extends DefOrUseImpl {
281
287
}
282
288
}
283
289
284
- private class DirectDef extends DefImpl , TDefImpl {
290
+ private class DirectDef extends OperandBasedDef , TDefImpl {
285
291
BaseSourceVariableInstruction base ;
286
292
287
293
DirectDef ( ) { this = TDefImpl ( base , address , ind ) }
@@ -295,7 +301,7 @@ private class DirectDef extends DefImpl, TDefImpl {
295
301
override predicate isCertain ( ) { isDef ( true , _, address , base , _, ind ) }
296
302
}
297
303
298
- private class IteratorDef extends DefImpl , TIteratorDef {
304
+ private class IteratorDef extends OperandBasedDef , TIteratorDef {
299
305
BaseSourceVariableInstruction container ;
300
306
301
307
IteratorDef ( ) { this = TIteratorDef ( address , container , ind ) }
@@ -1178,7 +1184,7 @@ class UseOrPhi extends SsaDefOrUse {
1178
1184
class Def extends DefOrUse {
1179
1185
override DefImpl defOrUse ;
1180
1186
1181
- Operand getAddressOperand ( ) { result = defOrUse .getAddressOperand ( ) }
1187
+ Operand getAddressOperand ( ) { result = defOrUse .( OperandBasedDef ) . getAddressOperand ( ) }
1182
1188
1183
1189
Instruction getAddress ( ) { result = this .getAddressOperand ( ) .getDef ( ) }
1184
1190
0 commit comments