Moved CollectObjCIvars to more commonly available place
for future use.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66184 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index a39095f..ca2b795 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -458,6 +458,8 @@
const ASTRecordLayout &getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D);
const RecordDecl *addRecordToClass(const ObjCInterfaceDecl *D);
+ void CollectObjCIvars(const ObjCInterfaceDecl *OI,
+ std::vector<FieldDecl*> &Fields) const;
const FieldDecl *getFieldDecl(const ObjCIvarRefExpr *MRef) {
llvm::DenseMap<const ObjCIvarRefExpr *, const FieldDecl*>::iterator I
= ASTFieldForIvarRef.find(MRef);
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 2100a66..4579fb5 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -576,8 +576,8 @@
Alignment = std::max(Alignment, FieldAlign);
}
-static void CollectObjCIvars(const ObjCInterfaceDecl *OI,
- std::vector<FieldDecl*> &Fields) {
+void ASTContext::CollectObjCIvars(const ObjCInterfaceDecl *OI,
+ std::vector<FieldDecl*> &Fields) const {
const ObjCInterfaceDecl *SuperClass = OI->getSuperClass();
if (SuperClass)
CollectObjCIvars(SuperClass, Fields);