move ImplementationClassInfo out of ASTContext into Sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42714 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index 76c0002..6830d24 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -1176,16 +1176,8 @@
}
// Check that there is no duplicate implementation of this class.
- bool err = false;
- for (unsigned i = 0; i != Context.sizeObjcImplementationClass(); i++) {
- if (Context.getObjcImplementationClass(i)->getIdentifier() == ClassName) {
- Diag(ClassLoc, diag::err_dup_implementation_class, ClassName->getName());
- err = true;
- break;
- }
- }
- if (!err)
- Context.setObjcImplementationClass(IMPDecl);
+ if (!ObjcImplementations.insert(ClassName))
+ Diag(ClassLoc, diag::err_dup_implementation_class, ClassName->getName());
return IMPDecl;
}