Remove CallExpr.getACallee().

This commit is contained in:
Max Schaefer
2020-02-05 13:52:18 +00:00
parent cf0e38b22c
commit 84002f585e
2 changed files with 3 additions and 16 deletions

View File

@@ -466,21 +466,6 @@ class CallExpr extends CallOrConversionExpr {
/** Gets the declared target of this call. */
Function getTarget() { this = result.getACallExpr() }
/**
* Gets the definition of a possible target of this call.
*
* For non-virtual calls, there is at most one possible call target (but there may be none if the
* target has no declaration).
*
* For virtual calls, we look up possible targets in all types that implement the receiver
* interface type.
*/
FuncDef getACallee() {
exists(DataFlow::CallNode call | call.asExpr() = this |
result = call.getACallee()
)
}
override predicate mayHaveOwnSideEffects() {
getTarget().mayHaveSideEffects() or
not exists(getTarget())

View File

@@ -7,7 +7,9 @@ DataFlowCallable viableImpl(DataFlowCall ma) { result = viableCallable(ma) }
* Gets a function that might be called by `call`.
*/
DataFlowCallable viableCallable(CallExpr ma) {
result = ma.getACallee()
exists(DataFlow::CallNode c | c.asExpr() = ma |
result = c.getACallee()
)
}
/**