Encapsulate the Objective-C id/Class/SEL "redefinition" types in
ASTContext with accessors/mutators. The only functional change is that
the AST writer won't bother writing the id/Class/SEL redefinition type
if it hasn't been explicitly set; previously, it ended up being
written as a synonym for the built-in id/Class/SEL.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137349 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprMember.cpp b/lib/Sema/SemaExprMember.cpp
index cde29f5..0fd654b 100644
--- a/lib/Sema/SemaExprMember.cpp
+++ b/lib/Sema/SemaExprMember.cpp
@@ -953,9 +953,9 @@
 
   QualType redef;
   if (ty->isObjCId()) {
-    redef = S.Context.ObjCIdRedefinitionType;
+    redef = S.Context.getObjCIdRedefinitionType();
   } else if (ty->isObjCClass()) {
-    redef = S.Context.ObjCClassRedefinitionType;
+    redef = S.Context.getObjCClassRedefinitionType();
   } else {
     return false;
   }
@@ -1322,8 +1322,9 @@
   // not just a pointer to builtin-sel again.
   if (IsArrow &&
       BaseType->isSpecificBuiltinType(BuiltinType::ObjCSel) &&
-      !Context.ObjCSelRedefinitionType->isObjCSelType()) {
-    BaseExpr = ImpCastExprToType(BaseExpr.take(), Context.ObjCSelRedefinitionType,
+      !Context.getObjCSelRedefinitionType()->isObjCSelType()) {
+    BaseExpr = ImpCastExprToType(BaseExpr.take(), 
+                                 Context.getObjCSelRedefinitionType(),
                                  CK_BitCast);
     return LookupMemberExpr(R, BaseExpr, IsArrow, OpLoc, SS,
                             ObjCImpDecl, HasTemplateArgs);