Introduce ObjCProtocolListLoc for keeping source location information for protocol references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83094 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp
index 77721bd..550f4db 100644
--- a/lib/Frontend/PCHReaderDecl.cpp
+++ b/lib/Frontend/PCHReaderDecl.cpp
@@ -179,6 +179,12 @@
 void TypeLocReader::VisitTypedefLoc(TypedefLoc TyLoc) {
   TyLoc.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
 }
+void TypeLocReader::VisitObjCProtocolListLoc(ObjCProtocolListLoc TyLoc) {
+  TyLoc.setLAngleLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+  TyLoc.setRAngleLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+  for (unsigned i = 0, e = TyLoc.getNumProtocols(); i != e; ++i)
+    TyLoc.setProtocolLoc(i, SourceLocation::getFromRawEncoding(Record[Idx++]));
+}
 void TypeLocReader::VisitPointerLoc(PointerLoc TyLoc) {
   TyLoc.setStarLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
 }
diff --git a/lib/Frontend/PCHWriterDecl.cpp b/lib/Frontend/PCHWriterDecl.cpp
index 6261db5..7a8f3e8 100644
--- a/lib/Frontend/PCHWriterDecl.cpp
+++ b/lib/Frontend/PCHWriterDecl.cpp
@@ -177,6 +177,12 @@
 void TypeLocWriter::VisitTypedefLoc(TypedefLoc TyLoc) {
   Writer.AddSourceLocation(TyLoc.getNameLoc(), Record);
 }
+void TypeLocWriter::VisitObjCProtocolListLoc(ObjCProtocolListLoc TyLoc) {
+  Writer.AddSourceLocation(TyLoc.getLAngleLoc(), Record);
+  Writer.AddSourceLocation(TyLoc.getRAngleLoc(), Record);
+  for (unsigned i = 0, e = TyLoc.getNumProtocols(); i != e; ++i)
+    Writer.AddSourceLocation(TyLoc.getProtocolLoc(i), Record);
+}
 void TypeLocWriter::VisitPointerLoc(PointerLoc TyLoc) {
   Writer.AddSourceLocation(TyLoc.getStarLoc(), Record);
 }