objc: Implemented variables declared in class interface 
whose sema decl is at the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67249 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index fb74519..9314134 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1233,7 +1233,9 @@
 // always null.
 void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl,
                       DeclTy **allMethods, unsigned allNum,
-                      DeclTy **allProperties, unsigned pNum) {
+                      DeclTy **allProperties, unsigned pNum,
+                      DeclTy **allTUVars,
+                      unsigned tuvNum) {
   Decl *ClassDecl = static_cast<Decl *>(classDecl);
 
   // FIXME: If we don't have a ClassDecl, we have an error. We should consider
@@ -1337,6 +1339,15 @@
       }
     }
   }
+  llvm::SmallVector<VarDecl*, 8> allTUVariables;
+  for (unsigned i = 0; i < tuvNum; i++) {
+    if (VarDecl *VD = dyn_cast<VarDecl>((Decl*)allTUVars[i]))
+      allTUVariables.push_back(VD);
+  }
+  if (!allTUVariables.empty() && isInterfaceDeclKind) {
+    ObjCContainerDecl *OCD = dyn_cast<ObjCContainerDecl>(ClassDecl);
+    OCD->setTUVarList(&allTUVariables[0], allTUVariables.size(), Context);
+  }
 }