From 7a77f1994bdbe67db361b851a0907cf49fddfd91 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 4 Jan 2013 23:32:24 +0000 Subject: objective-C arc: in copy helper function for __strong __block variables, perform objc_storeStrong on source and destination instead of direct move. This is done with -O0 and to improve some analysis. // rdar://12530881 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171555 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGBlocks.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/CodeGen/CGBlocks.cpp') diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 54bcb88ce3..e33e664430 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -1565,6 +1565,11 @@ public: llvm::Value *null = llvm::ConstantPointerNull::get(cast(value->getType())); + if (CGF.CGM.getCodeGenOpts().OptimizationLevel == 0) { + CGF.EmitARCStoreStrongCall(destField, value, /*ignored*/ true); + CGF.EmitARCStoreStrongCall(srcField, null, /*ignored*/ true); + return; + } llvm::StoreInst *store = CGF.Builder.CreateStore(value, destField); store->setAlignment(Alignment.getQuantity()); -- cgit v1.2.3-70-g09d2