summaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2021-09-08 11:58:03 -0700
committerAkira Hatanaka <ahatanaka@apple.com>2021-09-08 11:58:03 -0700
commitdea6f71af0fdd7c54cacd43f5fb15e293924fa20 (patch)
tree82006c734dd7cca81c15e9709ed95207e191c7c1 /llvm/lib/IR/Function.cpp
parent59cc39ae141f92c01836064cd033c537f16dec5e (diff)
[ObjC][ARC] Use the addresses of the ARC runtime functions instead of
integer 0/1 for the operand of bundle "clang.arc.attachedcall" https://reviews.llvm.org/D102996 changes the operand of bundle "clang.arc.attachedcall". This patch makes changes to llvm that are needed to handle the new IR. This should make it easier to understand what the IR is doing and also simplify some of the passes as they no longer have to translate the integer values to the runtime functions. Differential Revision: https://reviews.llvm.org/D103000
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 977cd852a330..9ec5a46a0204 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -1745,8 +1745,8 @@ Optional<Function *> Intrinsic::remangleIntrinsicFunction(Function *F) {
/// and llvm.compiler.used variables.
bool Function::hasAddressTaken(const User **PutOffender,
bool IgnoreCallbackUses,
- bool IgnoreAssumeLikeCalls,
- bool IgnoreLLVMUsed) const {
+ bool IgnoreAssumeLikeCalls, bool IgnoreLLVMUsed,
+ bool IgnoreARCAttachedCall) const {
for (const Use &U : uses()) {
const User *FU = U.getUser();
if (isa<BlockAddress>(FU))
@@ -1790,6 +1790,11 @@ bool Function::hasAddressTaken(const User **PutOffender,
return true;
}
if (!Call->isCallee(&U)) {
+ if (IgnoreARCAttachedCall &&
+ Call->isOperandBundleOfType(LLVMContext::OB_clang_arc_attachedcall,
+ U.getOperandNo()))
+ continue;
+
if (PutOffender)
*PutOffender = FU;
return true;