This patch removes mergeProperties and does the property lookup
in designated protocols lazily.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62007 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 49a8c83..d47f98a 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -340,7 +340,6 @@
void
Sema::MergeOneProtocolPropertiesIntoClass(Decl *CDecl,
ObjCProtocolDecl *PDecl) {
- llvm::SmallVector<ObjCPropertyDecl*, 16> mergeProperties;
ObjCInterfaceDecl *IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(CDecl);
if (!IDecl) {
// Category
@@ -355,14 +354,10 @@
CP != CE; ++CP)
if ((*CP)->getIdentifier() == Pr->getIdentifier())
break;
- if (CP == CE)
- // Add this property to list of properties for thie class.
- mergeProperties.push_back(Pr);
- else
+ if (CP != CE)
// Property protocol already exist in class. Diagnose any mismatch.
DiagnosePropertyMismatch((*CP), Pr, PDecl->getIdentifier());
}
- CatDecl->mergeProperties(&mergeProperties[0], mergeProperties.size());
return;
}
for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(),
@@ -374,14 +369,10 @@
CP != CE; ++CP)
if ((*CP)->getIdentifier() == Pr->getIdentifier())
break;
- if (CP == CE)
- // Add this property to list of properties for thie class.
- mergeProperties.push_back(Pr);
- else
+ if (CP != CE)
// Property protocol already exist in class. Diagnose any mismatch.
DiagnosePropertyMismatch((*CP), Pr, PDecl->getIdentifier());
}
- IDecl->mergeProperties(&mergeProperties[0], mergeProperties.size());
}
/// MergeProtocolPropertiesIntoClass - This routine merges properties