[cfe-commits] r65097 - /cfe/trunk/lib/CodeGen/CGExpr.cpp

Fariborz Jahanian fjahanian at apple.com
Thu Feb 19 17:14:43 PST 2009


Author: fjahanian
Date: Thu Feb 19 19:14:43 2009
New Revision: 65097

URL: http://llvm.org/viewvc/llvm-project?rev=65097&view=rev
Log:
More objc gc's ir-gen fixes.


Modified:
    cfe/trunk/lib/CodeGen/CGExpr.cpp

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=65097&r1=65096&r2=65097&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Thu Feb 19 19:14:43 2009
@@ -626,8 +626,12 @@
     else {
       llvm::Value *V = LocalDeclMap[VD];
       assert(V && "BlockVarDecl not entered in LocalDeclMap?");
-      LV = LValue::MakeAddr(V, E->getType().getCVRQualifiers(),
-                            getContext().getObjCGCAttrKind(E->getType()));
+      // local variables do not get their gc attribute set.
+      QualType::GCAttrTypes attr = QualType::GCNone;
+      // local static?
+      if (VD->getStorageClass() == VarDecl::Static)
+        attr = getContext().getObjCGCAttrKind(E->getType());
+      LV = LValue::MakeAddr(V, E->getType().getCVRQualifiers(), attr);
     }
     return LV;
   } else if (VD && VD->isFileVarDecl()) {
@@ -665,7 +669,8 @@
     {
       QualType T = E->getSubExpr()->getType()->getAsPointerType()->getPointeeType();
       return LValue::MakeAddr(EmitScalarExpr(E->getSubExpr()),
-                              ExprTy->getAsPointerType()->getPointeeType().getCVRQualifiers(), 
+                              ExprTy->getAsPointerType()->getPointeeType()
+                                      .getCVRQualifiers(), 
                               getContext().getObjCGCAttrKind(T));
     }
   case UnaryOperator::Real:





More information about the cfe-commits mailing list