Added support for objc's gc attribute in ExtQualType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64800 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 0edc6ee..6aec24f 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -1053,7 +1053,23 @@
 }
 
 void ExtQualType::getAsStringInternal(std::string &S) const {
-  S = "__attribute__((address_space("+llvm::utostr_32(AddressSpace)+")))" + S;
+  bool space = false;
+  if (ExtQualTypeKind & ASQUAL) {
+    S = "__attribute__((address_space("+llvm::utostr_32(AddressSpace)+")))" + S;
+    space = true;
+  }
+  if (ExtQualTypeKind & GCQUAL) {
+    if (space)
+      S += ' ';
+    S += "__attribute__((objc_gc(";
+    ObjCGCAttr *gcattr = getGCAttr();
+    ObjCGCAttr::GCAttrTypes attr = gcattr->getType();
+    if (attr & ObjCGCAttr::Weak)
+      S += "weak";
+    else
+      S += "strong";
+    S += ")))";
+  }
   BaseType->getAsStringInternal(S);
 }