diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2019-01-07 07:15:51 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2019-01-07 07:15:51 +0000 |
commit | 57578aaf96129bb2afbb75bc2523aa47fc1aa993 (patch) | |
tree | 52c5203b56697b5290e26cc32950652052700477 /llvm/lib/IR/Instructions.cpp | |
parent | fee1a04d04808301373ff82a67aef764a585c684 (diff) | |
download | bcm5719-llvm-57578aaf96129bb2afbb75bc2523aa47fc1aa993.tar.gz bcm5719-llvm-57578aaf96129bb2afbb75bc2523aa47fc1aa993.zip |
[CallSite removal] Port `IndirectCallSiteVisitor` to use `CallBase` and
update client code.
Also rename it to use the more generic term `call` instead of something
that could be confused with a praticular type.
Differential Revision: https://reviews.llvm.org/D56183
llvm-svn: 350508
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index e8b5811af56..c7437f6f4c5 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -257,6 +257,16 @@ void LandingPadInst::addClause(Constant *Val) { Function *CallBase::getCaller() { return getParent()->getParent(); } +bool CallBase::isIndirectCall() const { + const Value *V = getCalledValue(); + if (isa<Function>(V) || isa<Constant>(V)) + return false; + if (const CallInst *CI = dyn_cast<CallInst>(this)) + if (CI->isInlineAsm()) + return false; + return true; +} + Intrinsic::ID CallBase::getIntrinsicID() const { if (auto *F = getCalledFunction()) return F->getIntrinsicID(); |