summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-01-14 19:55:43 +0000
committerpatrick <patrick@openbsd.org>2017-01-14 19:55:43 +0000
commitbd3306aecb3a15e8967143b8cdbbccf2b1b19b74 (patch)
tree309a8132b44564b9e634c0da6815187ce8eab27c /gnu/llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp
parentkillp -a should not kill the window if only one pane. (diff)
downloadwireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.tar.xz
wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.zip
Import LLVM 3.9.1 including clang and lld.
Diffstat (limited to 'gnu/llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp')
-rw-r--r--gnu/llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp b/gnu/llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp
index 969e77c1f88..b2c62a0e8ee 100644
--- a/gnu/llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp
+++ b/gnu/llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp
@@ -70,7 +70,7 @@ void ObjCARCAPElim::getAnalysisUsage(AnalysisUsage &AU) const {
/// possibly produce autoreleases.
bool ObjCARCAPElim::MayAutorelease(ImmutableCallSite CS, unsigned Depth) {
if (const Function *Callee = CS.getCalledFunction()) {
- if (Callee->isDeclaration() || Callee->mayBeOverridden())
+ if (!Callee->hasExactDefinition())
return true;
for (const BasicBlock &BB : *Callee) {
for (const Instruction &I : BB)
@@ -132,6 +132,9 @@ bool ObjCARCAPElim::runOnModule(Module &M) {
if (!ModuleHasARC(M))
return false;
+ if (skipModule(M))
+ return false;
+
// Find the llvm.global_ctors variable, as the first step in
// identifying the global constructors. In theory, unnecessary autorelease
// pools could occur anywhere, but in practice it's pretty rare. Global