Patch to implement AST generation for objective-c's @selector expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43038 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index 366966f..4c06e7c 100644
--- a/AST/ASTContext.cpp
+++ b/AST/ASTContext.cpp
@@ -856,6 +856,20 @@
   IdStructType = rec;
 }
 
+void ASTContext::setObjcSelType(TypedefDecl *TD)
+{
+  assert(ObjcSelType.isNull() && "'SEL' type already set!");
+    
+  ObjcSelType = getTypedefType(TD);
+
+  // typedef struct objc_selector *SEL;
+  const PointerType *ptr = TD->getUnderlyingType()->getAsPointerType();
+  assert(ptr && "'SEL' incorrectly typed");
+  const RecordType *rec = ptr->getPointeeType()->getAsStructureType();
+  assert(rec && "'SEL' incorrectly typed");
+  SelStructType = rec;
+}
+
 void ASTContext::setObjcConstantStringInterface(ObjcInterfaceDecl *Decl) {
   assert(ObjcConstantStringType.isNull() && 
          "'NSConstantString' type already set!");