aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2016-01-28 18:49:28 +0000
committerManman Ren <manman.ren@gmail.com>2016-01-28 18:49:28 +0000
commit5b786407d04263c67cc864c4aa184e07e1f74a85 (patch)
treedbd6b02f8c73de379ca81dd8a05ca9ad1820d55c /clang/lib/Sema/SemaCodeComplete.cpp
parent64cfffd333b261ebb68a6ee04b09cc42d32c1992 (diff)
downloadllvm-5b786407d04263c67cc864c4aa184e07e1f74a85.zip
llvm-5b786407d04263c67cc864c4aa184e07e1f74a85.tar.gz
llvm-5b786407d04263c67cc864c4aa184e07e1f74a85.tar.bz2
Class Property: class property and instance property can have the same name.
Add "enum ObjCPropertyQueryKind" to a few APIs that used to only take the name of the property: ObjCPropertyDecl::findPropertyDecl, ObjCContainerDecl::FindPropertyDeclaration, ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass, ObjCImplDecl::FindPropertyImplDecl, and Sema::ActOnPropertyImplDecl. ObjCPropertyQueryKind currently has 3 values: OBJC_PR_query_unknown, OBJC_PR_query_instance, OBJC_PR_query_class This extra parameter specifies that we are looking for an instance property with the given name, or a class property with the given name, or any property with the given name (if both exist, the instance property will be returned). rdar://23891898 llvm-svn: 259070
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 59ab0ba..12aec6c 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -6189,7 +6189,7 @@ void Sema::CodeCompleteObjCPropertySynthesizeIvar(Scope *S,
// Figure out which interface we're looking into.
ObjCInterfaceDecl *Class = nullptr;
if (ObjCImplementationDecl *ClassImpl
- = dyn_cast<ObjCImplementationDecl>(Container))
+ = dyn_cast<ObjCImplementationDecl>(Container))
Class = ClassImpl->getClassInterface();
else
Class = cast<ObjCCategoryImplDecl>(Container)->getCategoryDecl()
@@ -6198,8 +6198,8 @@ void Sema::CodeCompleteObjCPropertySynthesizeIvar(Scope *S,
// Determine the type of the property we're synthesizing.
QualType PropertyType = Context.getObjCIdType();
if (Class) {
- if (ObjCPropertyDecl *Property
- = Class->FindPropertyDeclaration(PropertyName)) {
+ if (ObjCPropertyDecl *Property = Class->FindPropertyDeclaration(
+ PropertyName, ObjCPropertyQueryKind::OBJC_PR_query_instance)) {
PropertyType
= Property->getType().getNonReferenceType().getUnqualifiedType();