@@ -21,65 +21,6 @@ private import DataFlowDispatch as DataFlowDispatch
2121import ExprNodes
2222
2323
24- /**
25- * An operand that is defined by a `FieldAddressInstruction`.
26- */
27- class FieldAddress extends Operand {
28- FieldAddressInstruction fai ;
29-
30- FieldAddress ( ) { fai = this .getDef ( ) and not SsaImpl:: ignoreOperand ( this ) }
31-
32- /** Gets the field associated with this instruction. */
33- Field getField ( ) { result = fai .getField ( ) }
34-
35- /** Gets the instruction whose result provides the address of the object containing the field. */
36- Instruction getObjectAddress ( ) { result = fai .getObjectAddress ( ) }
37-
38- /** Gets the operand that provides the address of the object containing the field. */
39- Operand getObjectAddressOperand ( ) { result = fai .getObjectAddressOperand ( ) }
40- }
41-
42- /**
43- * Holds if `opFrom` is an operand whose value flows to the result of `instrTo`.
44- *
45- * `isPointerArith` is `true` if `instrTo` is a `PointerArithmeticInstruction` and `opFrom`
46- * is the left operand.
47- *
48- * `additional` is `true` if the conversion is supplied by an implementation of the
49- * `Indirection` class. It is sometimes useful to exclude such conversions.
50- */
51- predicate conversionFlow (
52- Operand opFrom , Instruction instrTo , boolean isPointerArith , boolean additional
53- ) {
54- isPointerArith = false and
55- (
56- additional = false and
57- (
58- instrTo .( CopyValueInstruction ) .getSourceValueOperand ( ) = opFrom
59- or
60- instrTo .( ConvertInstruction ) .getUnaryOperand ( ) = opFrom
61- or
62- instrTo .( CheckedConvertOrNullInstruction ) .getUnaryOperand ( ) = opFrom
63- or
64- instrTo .( InheritanceConversionInstruction ) .getUnaryOperand ( ) = opFrom
65- or
66- exists ( BuiltInInstruction builtIn |
67- builtIn = instrTo and
68- // __builtin_bit_cast
69- builtIn .getBuiltInOperation ( ) instanceof BuiltInBitCast and
70- opFrom = builtIn .getAnOperand ( )
71- )
72- )
73- or
74- additional = true and
75- SsaImpl:: isAdditionalConversionFlow ( opFrom , instrTo )
76- )
77- or
78- isPointerArith = true and
79- additional = false and
80- instrTo .( PointerArithmeticInstruction ) .getLeftOperand ( ) = opFrom
81- }
82-
8324/**
8425 * A node in a data flow graph.
8526 *
0 commit comments