diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-03 23:07:53 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-03 23:07:53 +0000 |
| commit | 469a20de757ff872c90ff6b1134f6346909ff652 (patch) | |
| tree | f62940cbeebc4b234743044db4827de3df4b963d /lib/CodeGen/CGExpr.cpp | |
| parent | 030ef472f31709e175895853fcb43d61d09022c7 (diff) | |
| download | clang-469a20de757ff872c90ff6b1134f6346909ff652.tar.gz clang-469a20de757ff872c90ff6b1134f6346909ff652.tar.bz2 clang-469a20de757ff872c90ff6b1134f6346909ff652.tar.xz | |
Truncate block variable of bool type to i1 when its
value is used. This matches with non-block variable
use of bool type. (Fixes radar 8390062).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index b4d0e13993..3750ab80c3 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -335,24 +335,6 @@ CodeGenFunction::EmitReferenceBindingToExpr(const Expr* E, llvm::Value *Value = EmitExprForReferenceBinding(*this, E, ReferenceTemporary, ReferenceTemporaryDtor, InitializedDecl); - if (E->getType()->isBooleanType()) { - // special handling for __block variable of bool type bound to - // a reference type. - bool block_byref_var = false; - if (const BlockDeclRefExpr *BE = dyn_cast<BlockDeclRefExpr>(E)) - block_byref_var = BE->isByRef(); - else if (const DeclRefExpr *BD = dyn_cast<DeclRefExpr>(E)) { - const NamedDecl *ND = BD->getDecl(); - if (const VarDecl *VD = dyn_cast<VarDecl>(ND)) - block_byref_var = VD->hasAttr<BlocksAttr>(); - } - if (block_byref_var) { - const llvm::Type *T = ConvertTypeForMem(E->getType()); - T = llvm::PointerType::getUnqual(T); - Value = Builder.CreateBitCast(Value, T); - } - } - if (!ReferenceTemporaryDtor) return RValue::get(Value); |
