[PATCH] D105313: [ValueTracking] Use call arguments for nonnull attribute check
Duncan P. N. Exon Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 9 15:12:00 PDT 2021
dexonsmith added a comment.
In D105313#2868067 <https://reviews.llvm.org/D105313#2868067>, @nikic wrote:
> Namely, what `getCalledFunction()` currently does is simply check whether `getCalledOperand()` is a function.
Duplicating slightly from my comment in https://reviews.llvm.org/D105733, scanning lib/Analysis it looks like many callers to expect it to see through bitcasts, like its header docs suggest it would. Note also that the `AbstractCallSite` version *does* look through bitcasts:
/// Return the function being called if this is a direct call, otherwise
/// return null (if it's an indirect call).
Function *getCalledFunction() const {
Value *V = getCalledOperand();
return V ? dyn_cast<Function>(V->stripPointerCasts()) : nullptr;
}
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105313/new/
https://reviews.llvm.org/D105313
More information about the llvm-commits
mailing list