diff options
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r-- | llvm/lib/IR/Function.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index a9beb0b..b1b8404 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -1752,7 +1752,8 @@ std::optional<Function *> Intrinsic::remangleIntrinsicFunction(Function *F) { bool Function::hasAddressTaken(const User **PutOffender, bool IgnoreCallbackUses, bool IgnoreAssumeLikeCalls, bool IgnoreLLVMUsed, - bool IgnoreARCAttachedCall) const { + bool IgnoreARCAttachedCall, + bool IgnoreCastedDirectCall) const { for (const Use &U : uses()) { const User *FU = U.getUser(); if (isa<BlockAddress>(FU)) @@ -1801,7 +1802,8 @@ bool Function::hasAddressTaken(const User **PutOffender, continue; } - if (!Call->isCallee(&U) || Call->getFunctionType() != getFunctionType()) { + if (!Call->isCallee(&U) || (!IgnoreCastedDirectCall && + Call->getFunctionType() != getFunctionType())) { if (IgnoreARCAttachedCall && Call->isOperandBundleOfType(LLVMContext::OB_clang_arc_attachedcall, U.getOperandNo())) |