summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-10-31 23:44:33 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-10-31 23:44:33 +0000
commitd8c4551fa22a9c346e6a9e56333915197c97e394 (patch)
treea9bcb86538105736401aed5ffdd28c8acb66c8fd /lib/CodeGen/CGExpr.cpp
parentc45061bd0c0fdad4df8eea7e9e5af186d11427e5 (diff)
downloadclang-d8c4551fa22a9c346e6a9e56333915197c97e394.tar.gz
clang-d8c4551fa22a9c346e6a9e56333915197c97e394.tar.bz2
clang-d8c4551fa22a9c346e6a9e56333915197c97e394.tar.xz
Adds IRGen support for captured rvalue references in blocks.
In this case, temporary value is copied into block descriptor as their own copy to work on. // rdar://9971124 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143399 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 9ad3ae8352..9680185b7f 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -1409,8 +1409,10 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
}
LValue CodeGenFunction::EmitBlockDeclRefLValue(const BlockDeclRefExpr *E) {
+ bool RefAsPointee =
+ E->getDecl()->getType()->isRValueReferenceType() ? true : false;
unsigned Alignment =
- getContext().getDeclAlign(E->getDecl()).getQuantity();
+ getContext().getDeclAlign(E->getDecl(), RefAsPointee).getQuantity();
return MakeAddrLValue(GetAddrOfBlockDecl(E), E->getType(), Alignment);
}