diff options
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 15 | ||||
-rw-r--r-- | clang/test/Index/TestClassDecl.m | 2 | ||||
-rw-r--r-- | clang/test/Index/TestClassForwardDecl.m | 2 | ||||
-rw-r--r-- | clang/test/Index/annotate-tokens.m | 4 | ||||
-rw-r--r-- | clang/test/Index/file-refs.m | 5 | ||||
-rw-r--r-- | clang/test/Index/properties-class-extensions.m | 2 | ||||
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 8 |
7 files changed, 13 insertions, 25 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 623e68b8a5a..4fdbfdb8362 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -2782,13 +2782,7 @@ CXCursorKind clang::getCursorKindForDecl(Decl *D) { case Decl::ObjCCategoryImpl: return CXCursor_ObjCCategoryImplDecl; case Decl::ObjCImplementation: return CXCursor_ObjCImplementationDecl; - case Decl::ObjCInterface: - if (cast<ObjCInterfaceDecl>(D)->isThisDeclarationADefinition()) - return CXCursor_ObjCInterfaceDecl; - - // Forward declarations are not directly exposed. - return CXCursor_UnexposedDecl; - + case Decl::ObjCInterface: return CXCursor_ObjCInterfaceDecl; case Decl::ObjCIvar: return CXCursor_ObjCIvarDecl; case Decl::ObjCMethod: return cast<ObjCMethodDecl>(D)->isInstanceMethod() @@ -2798,12 +2792,7 @@ CXCursorKind clang::getCursorKindForDecl(Decl *D) { case Decl::CXXDestructor: return CXCursor_Destructor; case Decl::CXXConversion: return CXCursor_ConversionFunction; case Decl::ObjCProperty: return CXCursor_ObjCPropertyDecl; - case Decl::ObjCProtocol: - if (cast<ObjCProtocolDecl>(D)->isThisDeclarationADefinition()) - return CXCursor_ObjCProtocolDecl; - - return CXCursor_UnexposedDecl; - + case Decl::ObjCProtocol: return CXCursor_ObjCProtocolDecl; case Decl::ParmVar: return CXCursor_ParmDecl; case Decl::Typedef: return CXCursor_TypedefDecl; case Decl::TypeAlias: return CXCursor_TypeAliasDecl; diff --git a/clang/test/Index/TestClassDecl.m b/clang/test/Index/TestClassDecl.m index 2abc39d78c2..038353b11dd 100644 --- a/clang/test/Index/TestClassDecl.m +++ b/clang/test/Index/TestClassDecl.m @@ -16,7 +16,7 @@ void function(Foo * arg) } // CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound -// CHECK-scan: [8:1 - 8:8] UnexposedDecl=Foo:8:8 +// CHECK-scan: [8:1 - 8:8] ObjCInterfaceDecl=Foo:8:8 // CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:10:12 // CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound // CHECK-scan: [10:1 - 11:5] ObjCInterfaceDecl=Foo:10:12 diff --git a/clang/test/Index/TestClassForwardDecl.m b/clang/test/Index/TestClassForwardDecl.m index b37f5ff937c..2f32d33c708 100644 --- a/clang/test/Index/TestClassForwardDecl.m +++ b/clang/test/Index/TestClassForwardDecl.m @@ -13,7 +13,7 @@ void function(Foo * arg) } // CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound -// CHECK-scan: [8:1 - 8:8] UnexposedDecl=Foo:8:8 +// CHECK-scan: [8:1 - 8:8] ObjCInterfaceDecl=Foo:8:8 // CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:8:8 // CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound // CHECK-scan: [10:1 - 10:15] FunctionDecl=function:10:6 (Definition) diff --git a/clang/test/Index/annotate-tokens.m b/clang/test/Index/annotate-tokens.m index c0e39e10e33..f9ddc655c2f 100644 --- a/clang/test/Index/annotate-tokens.m +++ b/clang/test/Index/annotate-tokens.m @@ -452,8 +452,8 @@ static Rdar8595462_A * Rdar8595462_staticVar; // CHECK: Punctuation: ")" [88:24 - 88:25] ObjCProtocolExpr=Proto:85:1 // CHECK: Punctuation: ";" [88:25 - 88:26] CompoundStmt= // CHECK: Punctuation: "}" [89:1 - 89:2] CompoundStmt= -// CHECK: Punctuation: "@" [93:1 - 93:2] UnexposedDecl=Rdar8595462_A:93:8 -// CHECK: Keyword: "class" [93:2 - 93:7] UnexposedDecl=Rdar8595462_A:93:8 +// CHECK: Punctuation: "@" [93:1 - 93:2] ObjCInterfaceDecl=Rdar8595462_A:93:8 +// CHECK: Keyword: "class" [93:2 - 93:7] ObjCInterfaceDecl=Rdar8595462_A:93:8 // CHECK: Identifier: "Rdar8595462_A" [93:8 - 93:21] ObjCClassRef=Rdar8595462_A:93:8 // CHECK: Punctuation: ";" [93:21 - 93:22] // CHECK: Punctuation: "@" [94:1 - 94:2] ObjCInterfaceDecl=Rdar8595462_B:94:12 diff --git a/clang/test/Index/file-refs.m b/clang/test/Index/file-refs.m index 3f9d33687a5..583826700de 100644 --- a/clang/test/Index/file-refs.m +++ b/clang/test/Index/file-refs.m @@ -43,8 +43,11 @@ void test2(Sub *s, id<Prot1> p) { // RUN: -file-refs-at=%s:7:18 \ // CHECK: ObjCImplementationDecl=Foo:7:17 (Definition) -// CHECK-NEXT: UnexposedDecl=Foo:1:8 =[1:8 - 1:11] + +// FIXME: There should not be 2 for the same range. +// CHECK-NEXT: ObjCInterfaceDecl=Foo:1:8 =[1:8 - 1:11] // CHECK-NEXT: ObjCClassRef=Foo:3:12 =[1:8 - 1:11] + // CHECK-NEXT: ObjCInterfaceDecl=Foo:3:12 =[3:12 - 3:15] // CHECK-NEXT: ObjCImplementationDecl=Foo:7:17 (Definition) =[7:17 - 7:20] // CHECK-NEXT: ObjCClassRef=Foo:3:12 =[13:11 - 13:14] diff --git a/clang/test/Index/properties-class-extensions.m b/clang/test/Index/properties-class-extensions.m index 96706d2aeb9..87830a7af1d 100644 --- a/clang/test/Index/properties-class-extensions.m +++ b/clang/test/Index/properties-class-extensions.m @@ -70,7 +70,7 @@ // CHECK-NOT: properties-class-extensions.m:16:25: ObjCInstanceMethodDecl=bar:16:25 Extent=[16:25 - 16:28] // CHECK: properties-class-extensions.m:19:26: ObjCInstanceMethodDecl=setBar::19:26 Extent=[19:26 - 19:29] // CHECK: properties-class-extensions.m:19:26: ParmDecl=bar:19:26 (Definition) Extent=[19:26 - 19:29] -// CHECK: properties-class-extensions.m:24:8: UnexposedDecl=Rdar8467189_Bar:24:8 +// CHECK: properties-class-extensions.m:24:8: ObjCInterfaceDecl=Rdar8467189_Bar:24:8 Extent=[24:1 - 24:23] // CHECK: properties-class-extensions.m:24:8: ObjCClassRef=Rdar8467189_Bar:24:8 Extent=[24:8 - 24:23] // CHECK: properties-class-extensions.m:25:11: ObjCProtocolDecl=Rdar8467189_FooProtocol:25:11 (Definition) Extent=[25:1 - 27:5] // CHECK: properties-class-extensions.m:26:39: ObjCPropertyDecl=Rdar8467189_Bar:26:39 Extent=[26:1 - 26:54] diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index fe4e373e8ac..f49d6f6cccd 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -3922,9 +3922,7 @@ CXCursor clang_getCursorReferenced(CXCursor C) { if (ObjCProtocolDecl *Def = Prot->getDefinition()) return MakeCXCursor(Def, tu); - CXCursor C = MakeCXCursor(Prot, tu); - C.kind = CXCursor_ObjCProtocolDecl; // override "Unexposed". - return C; + return MakeCXCursor(Prot, tu); } case CXCursor_ObjCClassRef: { @@ -3932,9 +3930,7 @@ CXCursor clang_getCursorReferenced(CXCursor C) { if (ObjCInterfaceDecl *Def = Class->getDefinition()) return MakeCXCursor(Def, tu); - CXCursor C = MakeCXCursor(Class, tu); - C.kind = CXCursor_ObjCInterfaceDecl; // override "Unexposed". - return C; + return MakeCXCursor(Class, tu); } case CXCursor_TypeRef: |