diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-04 23:32:24 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-04 23:32:24 +0000 |
commit | 7a77f1994bdbe67db361b851a0907cf49fddfd91 (patch) | |
tree | ea305d6b5c545b8ca62f20dbf83f7fcc35c6c934 /lib/CodeGen | |
parent | e3b29886ab053123feeb256e92bf8af23ba136cc (diff) |
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
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGBlocks.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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<llvm::PointerType>(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()); |