From 469a20de757ff872c90ff6b1134f6346909ff652 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 3 Sep 2010 23:07:53 +0000 Subject: 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 --- lib/CodeGen/CGExpr.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'lib/CodeGen/CGExpr.cpp') 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(E)) - block_byref_var = BE->isByRef(); - else if (const DeclRefExpr *BD = dyn_cast(E)) { - const NamedDecl *ND = BD->getDecl(); - if (const VarDecl *VD = dyn_cast(ND)) - block_byref_var = VD->hasAttr(); - } - 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); -- cgit v1.2.3