More objc's gc ir-gen stuff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65077 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 5c02100..b8c74e1 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -2417,9 +2417,14 @@
       getLangOptions().getGCMode() != LangOptions::NonGC) {
     GCAttrs = Ty.getObjCGCAttr();
     // Default behavious under objective-c's gc is for objective-c pointers
-    // be treated as though they were declared as __strong.
-    if (GCAttrs == QualType::GCNone && isObjCObjectPointerType(Ty))
-      GCAttrs = QualType::Strong;
+    // (or pointers to them) be treated as though they were declared 
+    // as __strong.
+    if (GCAttrs == QualType::GCNone) {
+      if (isObjCObjectPointerType(Ty))
+        GCAttrs = QualType::Strong;
+      else if (Ty->isPointerType())
+        return getObjCGCAttrKind(Ty->getAsPointerType()->getPointeeType());
+    }
   }
   return GCAttrs;
 }