[cfe-commits] r83316 - in /cfe/trunk: test/Index/c-index-api-test.m tools/CIndex/CIndex.cpp
Steve Naroff
snaroff at apple.com
Mon Oct 5 10:58:20 PDT 2009
Author: snaroff
Date: Mon Oct 5 12:58:19 2009
New Revision: 83316
URL: http://llvm.org/viewvc/llvm-project?rev=83316&view=rev
Log:
- Fix assert in clang_getCursorDecl (having to do with recently added ObjC_ProtocolRef).
- Make sure CHECK: lines in test case match the expected output.
Modified:
cfe/trunk/test/Index/c-index-api-test.m
cfe/trunk/tools/CIndex/CIndex.cpp
Modified: cfe/trunk/test/Index/c-index-api-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/c-index-api-test.m?rev=83316&r1=83315&r2=83316&view=diff
==============================================================================
--- cfe/trunk/test/Index/c-index-api-test.m (original)
+++ cfe/trunk/test/Index/c-index-api-test.m Mon Oct 5 12:58:19 2009
@@ -123,10 +123,10 @@
// CHECK: <invalid loc>:86:2: TypedefDecl=id:0:0 [Context:id]
// CHECK: <invalid loc>:86:3: TypedefDecl=id:0:0 [Context:id]
// CHECK: c-index-api-test.m:86:5: VarDecl=c:86:12 [Context:c]
-// CHECK: c-index-api-test.m:86:6: ObjCProtocolRef=SubP [Context:SubP]
-// CHECK: c-index-api-test.m:86:7: ObjCProtocolRef=SubP [Context:SubP]
-// CHECK: c-index-api-test.m:86:8: ObjCProtocolRef=SubP [Context:SubP]
-// CHECK: c-index-api-test.m:86:9: ObjCProtocolRef=SubP [Context:SubP]
+// CHECK: c-index-api-test.m:86:6: ObjCProtocolRef=SubP:86:12 [Context:SubP]
+// CHECK: c-index-api-test.m:86:7: ObjCProtocolRef=SubP:86:12 [Context:SubP]
+// CHECK: c-index-api-test.m:86:8: ObjCProtocolRef=SubP:86:12 [Context:SubP]
+// CHECK: c-index-api-test.m:86:9: ObjCProtocolRef=SubP:86:12 [Context:SubP]
// CHECK: c-index-api-test.m:86:10: VarDecl=c:86:12 [Context:c]
// CHECK: c-index-api-test.m:86:12: VarDecl=c:86:12 [Context:c]
// CHECK: c-index-api-test.m:86:13: VarDecl=c:86:12 [Context:c]
@@ -145,11 +145,11 @@
// CHECK: <invalid loc>:87:2: TypedefDecl=id:0:0 [Context:id]
// CHECK: <invalid loc>:87:3: TypedefDecl=id:0:0 [Context:id]
// CHECK: c-index-api-test.m:87:5: VarDecl=d:87:13 [Context:d]
-// CHECK: c-index-api-test.m:87:6: ObjCProtocolRef=Proto [Context:Proto]
-// CHECK: c-index-api-test.m:87:7: ObjCProtocolRef=Proto [Context:Proto]
-// CHECK: c-index-api-test.m:87:8: ObjCProtocolRef=Proto [Context:Proto]
-// CHECK: c-index-api-test.m:87:9: ObjCProtocolRef=Proto [Context:Proto]
-// CHECK: c-index-api-test.m:87:10: ObjCProtocolRef=Proto [Context:Proto]
+// CHECK: c-index-api-test.m:87:6: ObjCProtocolRef=Proto:87:13 [Context:Proto]
+// CHECK: c-index-api-test.m:87:7: ObjCProtocolRef=Proto:87:13 [Context:Proto]
+// CHECK: c-index-api-test.m:87:8: ObjCProtocolRef=Proto:87:13 [Context:Proto]
+// CHECK: c-index-api-test.m:87:9: ObjCProtocolRef=Proto:87:13 [Context:Proto]
+// CHECK: c-index-api-test.m:87:10: ObjCProtocolRef=Proto:87:13 [Context:Proto]
// CHECK: c-index-api-test.m:87:11: VarDecl=d:87:13 [Context:d]
// CHECK: c-index-api-test.m:87:13: VarDecl=d:87:13 [Context:d]
// CHECK: c-index-api-test.m:88:2: VarRef=d:87:13 [Context:main]
Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=83316&r1=83315&r2=83316&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Mon Oct 5 12:58:19 2009
@@ -606,7 +606,8 @@
if (clang_isReference(C.kind)) {
if (C.stmt) {
- if (C.kind == CXCursor_ObjCClassRef)
+ if (C.kind == CXCursor_ObjCClassRef ||
+ C.kind == CXCursor_ObjCProtocolRef)
return static_cast<Stmt *>(C.stmt);
else
return getDeclFromExpr(static_cast<Stmt *>(C.stmt));
More information about the cfe-commits
mailing list