]> granicus.if.org Git - clang/commitdiff
Minor cleanup. No change otherwise.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 19 Nov 2010 18:17:09 +0000 (18:17 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 19 Nov 2010 18:17:09 +0000 (18:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119814 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp

index 286665da86737d7aac2fa0ffcae26ce328d60ea1..7682baa8e5938428de43be0d7aa60573d005d592 100644 (file)
@@ -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<BlocksAttr>();
+    bool NonGCable = VD->hasLocalStorage() &&
+                     !VD->getType()->isReferenceType() &&
+                     !VD->hasAttr<BlocksAttr>();
 
     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);
     }