diff options
-rw-r--r-- | include/clang-c/Index.h | 6 | ||||
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 10 | ||||
-rw-r--r-- | test/Index/annotate-tokens.m | 8 | ||||
-rw-r--r-- | test/Index/properties-class-extensions.m | 2 | ||||
-rw-r--r-- | test/Index/usrs.m | 2 | ||||
-rw-r--r-- | tools/libclang/CIndex.cpp | 6 |
6 files changed, 26 insertions, 8 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index c79475eff4..cb0b3c1bab 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -1187,8 +1187,12 @@ enum CXCursorKind { CXCursor_UsingDeclaration = 35, /** \brief A C++ alias declaration */ CXCursor_TypeAliasDecl = 36, + /** \brief An Objective-C @synthesize definition. */ + CXCursor_ObjCSynthesizeDecl = 37, + /** \brief An Objective-C @dynamic definition. */ + CXCursor_ObjCDynamicDecl = 38, CXCursor_FirstDecl = CXCursor_UnexposedDecl, - CXCursor_LastDecl = CXCursor_TypeAliasDecl, + CXCursor_LastDecl = CXCursor_ObjCDynamicDecl, /* References */ CXCursor_FirstRef = 40, /* Decl references */ diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 294c7934f8..0b6cf87de5 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -2658,6 +2658,16 @@ CXCursorKind clang::getCursorKindForDecl(Decl *D) { case Decl::UnresolvedUsingTypename: return CXCursor_UsingDeclaration; + case Decl::ObjCPropertyImpl: + switch (cast<ObjCPropertyImplDecl>(D)->getPropertyImplementation()) { + case ObjCPropertyImplDecl::Dynamic: + return CXCursor_ObjCDynamicDecl; + + case ObjCPropertyImplDecl::Synthesize: + return CXCursor_ObjCSynthesizeDecl; + } + break; + default: if (TagDecl *TD = dyn_cast<TagDecl>(D)) { switch (TD->getTagKind()) { diff --git a/test/Index/annotate-tokens.m b/test/Index/annotate-tokens.m index f977e5c3df..1eb77940da 100644 --- a/test/Index/annotate-tokens.m +++ b/test/Index/annotate-tokens.m @@ -500,10 +500,10 @@ static Rdar8595462_A * Rdar8595462_staticVar; // CHECK: Punctuation: "*" [111:26 - 111:27] ObjCPropertyDecl=foo2:111:27 // CHECK: Identifier: "foo2" [111:27 - 111:31] ObjCPropertyDecl=foo2:111:27 -// CHECK: Punctuation: "@" [115:1 - 115:2] UnexposedDecl=foo:110:33 (Definition) -// CHECK: Keyword: "synthesize" [115:2 - 115:12] UnexposedDecl=foo:110:33 (Definition) -// CHECK: Identifier: "foo" [115:13 - 115:16] UnexposedDecl=foo:110:33 (Definition) -// CHECK: Punctuation: "=" [115:17 - 115:18] UnexposedDecl=foo:110:33 (Definition) +// CHECK: Punctuation: "@" [115:1 - 115:2] ObjCSynthesizeDecl=foo:110:33 (Definition) +// CHECK: Keyword: "synthesize" [115:2 - 115:12] ObjCSynthesizeDecl=foo:110:33 (Definition) +// CHECK: Identifier: "foo" [115:13 - 115:16] ObjCSynthesizeDecl=foo:110:33 (Definition) +// CHECK: Punctuation: "=" [115:17 - 115:18] ObjCSynthesizeDecl=foo:110:33 (Definition) // CHECK: Identifier: "_foo" [115:19 - 115:23] MemberRef=_foo:107:8 // CHECK: Punctuation: ";" [115:23 - 115:24] ObjCImplementationDecl=Rdar8595386:114:1 (Definition) diff --git a/test/Index/properties-class-extensions.m b/test/Index/properties-class-extensions.m index ecedc60c82..de612425c2 100644 --- a/test/Index/properties-class-extensions.m +++ b/test/Index/properties-class-extensions.m @@ -95,5 +95,5 @@ // CHECK: properties-class-extensions.m:38:34: ObjCInstanceMethodDecl=qux:38:34 Extent=[38:34 - 38:37] // CHECK: properties-class-extensions.m:38:34: ObjCInstanceMethodDecl=setQux::38:34 Extent=[38:34 - 38:37] // CHECK: properties-class-extensions.m:38:34: ParmDecl=qux:38:34 (Definition) Extent=[38:34 - 38:37] -// CHECK: properties-class-extensions.m:42:10: UnexposedDecl=qux:38:34 (Definition) Extent=[42:1 - 42:13] +// CHECK: properties-class-extensions.m:42:10: ObjCDynamicDecl=qux:38:34 (Definition) Extent=[42:1 - 42:13] diff --git a/test/Index/usrs.m b/test/Index/usrs.m index 4b79fdcbba..2830647019 100644 --- a/test/Index/usrs.m +++ b/test/Index/usrs.m @@ -195,7 +195,7 @@ int test_multi_declaration(void) { // CHECK-source: usrs.m:42:10: UnexposedExpr= Extent=[42:10 - 42:11] // CHECK-source: usrs.m:42:10: UnexposedExpr= Extent=[42:10 - 42:11] // CHECK-source: usrs.m:44:13: ObjCIvarDecl=d1:44:13 (Definition) Extent=[44:13 - 44:15] -// CHECK-source: usrs.m:44:13: UnexposedDecl=d1:31:15 (Definition) Extent=[44:1 - 44:15] +// CHECK-source: usrs.m:44:13: ObjCSynthesizeDecl=d1:31:15 (Definition) Extent=[44:1 - 44:15] // CHECK-source: usrs.m:47:5: VarDecl=z:47:5 Extent=[47:1 - 47:6] // CHECK-source: usrs.m:49:12: FunctionDecl=local_func:49:12 (Definition) Extent=[49:1 - 49:43] // CHECK-source: usrs.m:49:27: ParmDecl=x:49:27 (Definition) Extent=[49:23 - 49:28] diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 7348491072..2a9d96db4c 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -3381,7 +3381,11 @@ CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) { case CXCursor_UsingDeclaration: return createCXString("UsingDeclaration"); case CXCursor_TypeAliasDecl: - return createCXString("TypeAliasDecl"); + return createCXString("TypeAliasDecl"); + case CXCursor_ObjCSynthesizeDecl: + return createCXString("ObjCSynthesizeDecl"); + case CXCursor_ObjCDynamicDecl: + return createCXString("ObjCDynamicDecl"); } llvm_unreachable("Unhandled CXCursorKind"); |