summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-03-16 02:53:38 +0000
committerJohn McCall <rjmccall@apple.com>2011-03-16 02:53:38 +0000
commite99e5dcbd30cdc3b38da46a4ec57dff8557a3fe4 (patch)
tree93ee959e4b1bada56a934fe515785f9cf7ee9bdb /clang/lib
parenta3d4749e24b5e60d658979361be1805f67324813 (diff)
downloadbcm5719-llvm-e99e5dcbd30cdc3b38da46a4ec57dff8557a3fe4.tar.gz
bcm5719-llvm-e99e5dcbd30cdc3b38da46a4ec57dff8557a3fe4.zip
Don't emit read barriers for reading __weak __block variables
in non-GC mode. llvm-svn: 127725
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index 8326dcc7a8d..27b868974d5 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -1221,10 +1221,8 @@ Value *ScalarExprEmitter::VisitStmtExpr(const StmtExpr *E) {
}
Value *ScalarExprEmitter::VisitBlockDeclRefExpr(const BlockDeclRefExpr *E) {
- llvm::Value *V = CGF.GetAddrOfBlockDecl(E);
- if (E->getType().isObjCGCWeak())
- return CGF.CGM.getObjCRuntime().EmitObjCWeakRead(CGF, V);
- return CGF.EmitLoadOfScalar(V, false, 0, E->getType());
+ LValue LV = CGF.EmitBlockDeclRefLValue(E);
+ return CGF.EmitLoadOfLValue(LV, E->getType()).getScalarVal();
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud