diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -1398,7 +1398,8 @@ } /// Return true if the callsite is an indirect call. - bool isIndirectCall() const; + /// Optionally consider if inline asm may have an indirect call. + bool isIndirectCall(const bool InlineAsmMayHaveIndirectCall = false) const; /// Determine whether the passed iterator points to the callee operand's Use. bool isCallee(Value::const_user_iterator UI) const { diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -282,11 +282,11 @@ return cast(this)->getNumIndirectDests() + 1; } -bool CallBase::isIndirectCall() const { +bool CallBase::isIndirectCall(const bool InlineAsmMayHaveIndirectCall) const { const Value *V = getCalledOperand(); if (isa(V) || isa(V)) return false; - return !isInlineAsm(); + return InlineAsmMayHaveIndirectCall == isInlineAsm(); } /// Tests if this call site must be tail call optimized. Only a CallInst can