Implementation of AST for @protocol expression.

llvm-svn: 43075
diff --git a/clang/AST/ASTContext.cpp b/clang/AST/ASTContext.cpp
index 4c06e7c..cf617d1 100644
--- a/clang/AST/ASTContext.cpp
+++ b/clang/AST/ASTContext.cpp
@@ -870,6 +870,17 @@
   SelStructType = rec;
 }
 
+void ASTContext::setObjcProtoType(TypedefDecl *TD)
+{
+  assert(ObjcProtoType.isNull() && "'Protocol' type already set!");
+  
+  // typedef struct Protocol Protocol;
+  ObjcProtoType = TD->getUnderlyingType();
+  // Protocol * type
+  ObjcProtoType = getPointerType(ObjcProtoType);  
+  ProtoStructType = TD->getUnderlyingType()->getAsStructureType();
+}
+
 void ASTContext::setObjcConstantStringInterface(ObjcInterfaceDecl *Decl) {
   assert(ObjcConstantStringType.isNull() && 
          "'NSConstantString' type already set!");