From: Fariborz Jahanian Date: Fri, 19 Nov 2010 18:17:09 +0000 (+0000) Subject: Minor cleanup. No change otherwise. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75f91d6c5d654cb8570e299e19b18fe8aff4bba6;p=clang Minor cleanup. No change otherwise. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119814 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 286665da86..7682baa8e5 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1181,7 +1181,9 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { if (VD->hasExternalStorage() || VD->isFileVarDecl()) return EmitGlobalVarDeclLValue(*this, E, VD); - bool NonGCable = VD->hasLocalStorage() && !VD->hasAttr(); + bool NonGCable = VD->hasLocalStorage() && + !VD->getType()->isReferenceType() && + !VD->hasAttr(); llvm::Value *V = LocalDeclMap[VD]; if (!V && VD->isStaticLocal()) @@ -1198,7 +1200,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { V = Builder.CreateLoad(V, "tmp"); LValue LV = MakeAddrLValue(V, E->getType(), Alignment); - if (NonGCable && !VD->getType()->isReferenceType()) { + if (NonGCable) { LV.getQuals().removeObjCGCAttr(); LV.setNonGC(true); }