[cfe-commits] r171572 - in /cfe/trunk: lib/CodeGen/CGBlocks.cpp test/CodeGenObjC/arc-unoptimized-byref-var.m
Fariborz Jahanian
fjahanian at apple.com
Fri Jan 4 16:32:14 PST 2013
Author: fjahanian
Date: Fri Jan 4 18:32:13 2013
New Revision: 171572
URL: http://llvm.org/viewvc/llvm-project?rev=171572&view=rev
Log:
In my last patch initialize the destination to null (with a simple store) before doing a storeStrong to it.
// rdar://12530881
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/test/CodeGenObjC/arc-unoptimized-byref-var.m
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=171572&r1=171571&r2=171572&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Fri Jan 4 18:32:13 2013
@@ -1566,6 +1566,8 @@
llvm::ConstantPointerNull::get(cast<llvm::PointerType>(value->getType()));
if (CGF.CGM.getCodeGenOpts().OptimizationLevel == 0) {
+ llvm::StoreInst *store = CGF.Builder.CreateStore(null, destField);
+ store->setAlignment(Alignment.getQuantity());
CGF.EmitARCStoreStrongCall(destField, value, /*ignored*/ true);
CGF.EmitARCStoreStrongCall(srcField, null, /*ignored*/ true);
return;
Modified: cfe/trunk/test/CodeGenObjC/arc-unoptimized-byref-var.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-unoptimized-byref-var.m?rev=171572&r1=171571&r2=171572&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-unoptimized-byref-var.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-unoptimized-byref-var.m Fri Jan 4 18:32:13 2013
@@ -7,6 +7,7 @@
// CHECK-UNOPT: [[X:%.*]] = getelementptr inbounds [[BYREF_T:%.*]]* [[VAR:%.*]], i32 0, i32 6
// CHECK-UNOPT: [[X2:%.*]] = getelementptr inbounds [[BYREF_T:%.*]]* [[VAR1:%.*]], i32 0, i32 6
// CHECK-UNOPT-NEXT: [[SIX:%.*]] = load i8** [[X2]], align 8
+// CHECK-UNOPT-NEXT: store i8* null, i8** [[X]], align 8
// CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[X]], i8* [[SIX]]) nounwind
// CHECK-UNOPT-NEXT: call void @objc_storeStrong(i8** [[X2]], i8* null) nounwind
// CHECK-UNOPT-NEXT: ret void
More information about the cfe-commits
mailing list