@@ -244,17 +244,6 @@ Instruction getDestinationAddress(Instruction instr) {
244244 ]
245245}
246246
247- class ReferenceToInstruction extends CopyValueInstruction {
248- ReferenceToInstruction ( ) {
249- this .getResultType ( ) instanceof Cpp:: ReferenceType and
250- not this .getUnary ( ) .getResultType ( ) instanceof Cpp:: ReferenceType
251- }
252-
253- Instruction getSourceAddress ( ) { result = getSourceAddressOperand ( ) .getDef ( ) }
254-
255- Operand getSourceAddressOperand ( ) { result = this .getUnaryOperand ( ) }
256- }
257-
258247/** Gets the source address of `instr` if it is an instruction that behaves like a `LoadInstruction`. */
259248Instruction getSourceAddress ( Instruction instr ) { result = getSourceAddressOperand ( instr ) .getDef ( ) }
260249
@@ -266,11 +255,7 @@ Operand getSourceAddressOperand(Instruction instr) {
266255 result =
267256 [
268257 instr .( LoadInstruction ) .getSourceAddressOperand ( ) ,
269- instr .( ReadSideEffectInstruction ) .getArgumentOperand ( ) ,
270- // `ReferenceToInstruction` is really more of an address-of operation,
271- // but by including it in this list we break out of `flowOutOfAddressStep` at an
272- // instruction that, at the source level, looks like a use of a variable.
273- instr .( ReferenceToInstruction ) .getSourceAddressOperand ( )
258+ instr .( ReadSideEffectInstruction ) .getArgumentOperand ( )
274259 ]
275260}
276261
@@ -295,10 +280,6 @@ Operand getSourceValueOperand(Instruction instr) {
295280 result = instr .( LoadInstruction ) .getSourceValueOperand ( )
296281 or
297282 result = instr .( ReadSideEffectInstruction ) .getSideEffectOperand ( )
298- or
299- // See the comment on the `ReferenceToInstruction` disjunct in `getSourceAddressOperand` for why
300- // this case is included.
301- result = instr .( ReferenceToInstruction ) .getSourceValueOperand ( )
302283}
303284
304285/**
0 commit comments