First step toward fixing <rdar://problem/6613046> refactor clang objc type representation.

Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).

This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types). 

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73649 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index 765fecb..3b1eb08 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -229,12 +229,14 @@
   Code = pch::TYPE_OBJC_QUALIFIED_INTERFACE;
 }
 
-void PCHTypeWriter::VisitObjCQualifiedIdType(const ObjCQualifiedIdType *T) {
+void
+PCHTypeWriter::VisitObjCObjectPointerType(const ObjCObjectPointerType *T) {
+  Writer.AddDeclRef(T->getDecl(), Record);
   Record.push_back(T->getNumProtocols());
-  for (ObjCQualifiedIdType::qual_iterator I = T->qual_begin(),
+  for (ObjCInterfaceType::qual_iterator I = T->qual_begin(),
        E = T->qual_end(); I != E; ++I)
     Writer.AddDeclRef(*I, Record);
-  Code = pch::TYPE_OBJC_QUALIFIED_ID;
+  Code = pch::TYPE_OBJC_OBJECT_POINTER;
 }
 
 //===----------------------------------------------------------------------===//
@@ -407,7 +409,7 @@
   RECORD(TYPE_ENUM);
   RECORD(TYPE_OBJC_INTERFACE);
   RECORD(TYPE_OBJC_QUALIFIED_INTERFACE);
-  RECORD(TYPE_OBJC_QUALIFIED_ID);
+  RECORD(TYPE_OBJC_OBJECT_POINTER);
   // Statements and Exprs can occur in the Types block.
   AddStmtsExprs(Stream, Record);