summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2019-09-19 20:58:51 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2019-09-19 20:58:51 +0000
commit75fbb171c3093cb325972b989f240383711635f4 (patch)
treed75d5054086b13592aaf500512645f44e4dd2332 /llvm/lib/Transforms
parentf5fcf6156656421c50b78aff1192b4a40603b86f (diff)
downloadbcm5719-llvm-75fbb171c3093cb325972b989f240383711635f4.tar.gz
bcm5719-llvm-75fbb171c3093cb325972b989f240383711635f4.zip
[ObjC][ARC] Skip debug instructions when computing the insert point of
objc_release calls This fixes a bug where the presence of debug instructions would cause ARC optimizer to change the order of retain and release calls. rdar://problem/55319419 llvm-svn: 372352
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/ObjCARC/PtrState.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/ObjCARC/PtrState.cpp b/llvm/lib/Transforms/ObjCARC/PtrState.cpp
index 3243481dee0..26dd416d618 100644
--- a/llvm/lib/Transforms/ObjCARC/PtrState.cpp
+++ b/llvm/lib/Transforms/ObjCARC/PtrState.cpp
@@ -275,6 +275,10 @@ void BottomUpPtrState::HandlePotentialUse(BasicBlock *BB, Instruction *Inst,
} else {
InsertAfter = std::next(Inst->getIterator());
}
+
+ if (InsertAfter != BB->end())
+ InsertAfter = skipDebugIntrinsics(InsertAfter);
+
InsertReverseInsertPt(&*InsertAfter);
};
OpenPOWER on IntegriCloud