|
1 | | -import python |
2 | | -private import LegacyPointsTo |
3 | | -private import semmle.python.pointsto.PointsTo |
4 | | -private import semmle.python.objects.ObjectInternal |
| 1 | +private import python |
5 | 2 | private import semmle.python.internal.CachedStages |
6 | 3 |
|
7 | 4 | /** An expression */ |
@@ -53,71 +50,6 @@ class Expr extends Expr_, AstNode { |
53 | 50 | Expr getASubExpression() { none() } |
54 | 51 |
|
55 | 52 | override AstNode getAChildNode() { result = this.getASubExpression() } |
56 | | - |
57 | | - /** |
58 | | - * NOTE: `refersTo` will be deprecated in 2019. Use `pointsTo` instead. |
59 | | - * Gets what this expression might "refer-to". Performs a combination of localized (intra-procedural) points-to |
60 | | - * analysis and global module-level analysis. This points-to analysis favours precision over recall. It is highly |
61 | | - * precise, but may not provide information for a significant number of flow-nodes. |
62 | | - * If the class is unimportant then use `refersTo(value)` or `refersTo(value, origin)` instead. |
63 | | - * NOTE: For complex dataflow, involving multiple stages of points-to analysis, it may be more precise to use |
64 | | - * `ControlFlowNode.refersTo(...)` instead. |
65 | | - */ |
66 | | - predicate refersTo(Object obj, ClassObject cls, AstNode origin) { |
67 | | - this.refersTo(_, obj, cls, origin) |
68 | | - } |
69 | | - |
70 | | - /** |
71 | | - * NOTE: `refersTo` will be deprecated in 2019. Use `pointsTo` instead. |
72 | | - * Gets what this expression might "refer-to" in the given `context`. |
73 | | - */ |
74 | | - predicate refersTo(Context context, Object obj, ClassObject cls, AstNode origin) { |
75 | | - this.getAFlowNode() |
76 | | - .(ControlFlowNodeWithPointsTo) |
77 | | - .refersTo(context, obj, cls, origin.getAFlowNode()) |
78 | | - } |
79 | | - |
80 | | - /** |
81 | | - * NOTE: `refersTo` will be deprecated in 2019. Use `pointsTo` instead. |
82 | | - * Holds if this expression might "refer-to" to `value` which is from `origin` |
83 | | - * Unlike `this.refersTo(value, _, origin)`, this predicate includes results |
84 | | - * where the class cannot be inferred. |
85 | | - */ |
86 | | - pragma[nomagic] |
87 | | - predicate refersTo(Object obj, AstNode origin) { |
88 | | - this.getAFlowNode().(ControlFlowNodeWithPointsTo).refersTo(obj, origin.getAFlowNode()) |
89 | | - } |
90 | | - |
91 | | - /** |
92 | | - * NOTE: `refersTo` will be deprecated in 2019. Use `pointsTo` instead. |
93 | | - * Equivalent to `this.refersTo(value, _)` |
94 | | - */ |
95 | | - predicate refersTo(Object obj) { this.refersTo(obj, _) } |
96 | | - |
97 | | - /** |
98 | | - * Holds if this expression might "point-to" to `value` which is from `origin` |
99 | | - * in the given `context`. |
100 | | - */ |
101 | | - predicate pointsTo(Context context, Value value, AstNode origin) { |
102 | | - this.getAFlowNode() |
103 | | - .(ControlFlowNodeWithPointsTo) |
104 | | - .pointsTo(context, value, origin.getAFlowNode()) |
105 | | - } |
106 | | - |
107 | | - /** |
108 | | - * Holds if this expression might "point-to" to `value` which is from `origin`. |
109 | | - */ |
110 | | - predicate pointsTo(Value value, AstNode origin) { |
111 | | - this.getAFlowNode().(ControlFlowNodeWithPointsTo).pointsTo(value, origin.getAFlowNode()) |
112 | | - } |
113 | | - |
114 | | - /** |
115 | | - * Holds if this expression might "point-to" to `value`. |
116 | | - */ |
117 | | - predicate pointsTo(Value value) { this.pointsTo(value, _) } |
118 | | - |
119 | | - /** Gets a value that this expression might "point-to". */ |
120 | | - Value pointsTo() { this.pointsTo(result) } |
121 | 53 | } |
122 | 54 |
|
123 | 55 | /** An assignment expression, such as `x := y` */ |
|
0 commit comments