diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-01-26 23:08:27 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-01-26 23:08:27 +0000 |
commit | 52a80e19ad688091723a52ad53337767bb0ac684 (patch) | |
tree | 1f7640e3e6f00ff3c289fbf968d3b22ff2cc2b6b /lib/CodeGen/CGExpr.cpp | |
parent | d1a2643a045b428ea3095f9fe18e7a0b54d61470 (diff) |
Fixes an IRgen bug where __block variable is
referenced in the block-literal initializer
of that variable. // rdar://8893785
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index afc1e0709e..ca80d3dd38 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1164,12 +1164,9 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { V = CGM.getStaticLocalDeclAddress(VD); assert(V && "DeclRefExpr not entered in LocalDeclMap?"); - if (VD->hasAttr<BlocksAttr>()) { - V = Builder.CreateStructGEP(V, 1, "forwarding"); - V = Builder.CreateLoad(V); - V = Builder.CreateStructGEP(V, getByRefValueLLVMField(VD), - VD->getNameAsString()); - } + if (VD->hasAttr<BlocksAttr>()) + V = BuildBlockByrefAddress(V, VD); + if (VD->getType()->isReferenceType()) V = Builder.CreateLoad(V, "tmp"); |