[cfe-commits] r93760 - in /cfe/trunk: include/clang-c/Index.h test/Index/TestClassDecl.m test/Index/TestClassForwardDecl.m test/Index/c-index-api-fn-scan.m test/Index/c-index-api-loadTU-test.m test/Index/cindex-from-source.m tools/CIndex/CIndex.exports tools/CIndex/CIndexUSRs.cpp tools/c-index-test/c-index-test.c

Ted Kremenek kremenek at apple.com
Mon Jan 18 12:23:30 PST 2010


Author: kremenek
Date: Mon Jan 18 14:23:29 2010
New Revision: 93760

URL: http://llvm.org/viewvc/llvm-project?rev=93760&view=rev
Log:
Replace clang_getDeclUSR() with clang_getCursorUSR().  Also remove printing 'contexts' from c-index-test output; it wasn't helpful and was extremely brittle.

Modified:
    cfe/trunk/include/clang-c/Index.h
    cfe/trunk/test/Index/TestClassDecl.m
    cfe/trunk/test/Index/TestClassForwardDecl.m
    cfe/trunk/test/Index/c-index-api-fn-scan.m
    cfe/trunk/test/Index/c-index-api-loadTU-test.m
    cfe/trunk/test/Index/cindex-from-source.m
    cfe/trunk/tools/CIndex/CIndex.exports
    cfe/trunk/tools/CIndex/CIndexUSRs.cpp
    cfe/trunk/tools/c-index-test/c-index-test.c

Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=93760&r1=93759&r2=93760&view=diff

==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Mon Jan 18 14:23:29 2010
@@ -336,7 +336,6 @@
 CINDEX_LINKAGE CXString clang_getDeclSpelling(CXDecl);
 CINDEX_LINKAGE unsigned clang_getDeclLine(CXDecl);
 CINDEX_LINKAGE unsigned clang_getDeclColumn(CXDecl);
-CINDEX_LINKAGE CXString clang_getDeclUSR(CXDecl);
 CINDEX_LINKAGE const char *clang_getDeclSource(CXDecl); /* deprecate */
 CINDEX_LINKAGE CXFile clang_getDeclSourceFile(CXDecl);
 
@@ -370,6 +369,10 @@
                          
 CINDEX_LINKAGE CXCursor clang_getNullCursor(void);
 
+/* clang_getCursorUSR() returns the USR (if any) associated with entity referred to by the
+ *   provided CXCursor object. */
+CINDEX_LINKAGE CXString clang_getCursorUSR(CXCursor);
+
 CINDEX_LINKAGE enum CXCursorKind clang_getCursorKind(CXCursor);
 CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind);
 CINDEX_LINKAGE unsigned clang_isReference(enum CXCursorKind);

Modified: cfe/trunk/test/Index/TestClassDecl.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/TestClassDecl.m?rev=93760&r1=93759&r2=93760&view=diff

==============================================================================
--- cfe/trunk/test/Index/TestClassDecl.m (original)
+++ cfe/trunk/test/Index/TestClassDecl.m Mon Jan 18 14:23:29 2010
@@ -32,7 +32,7 @@
 // CHECK-scan: {start_line=13 start_col=24 end_line=16 end_col=1} FunctionDefn=function:13:6
 // CHECK-scan: {start_line=16 start_col=2 end_line=38 end_col=1} Invalid Cursor => NoDeclFound
 
-// CHECK-load: TestClassDecl.m:10:12: ObjCInterfaceDecl=Foo:10:1 [Context=TestClassDecl.m] [Extent=10:1:11:4]
-// CHECK-load: TestClassDecl.m:13:6: FunctionDefn=function:13:6 [Context=TestClassDecl.m] [Extent=13:6:16:1]
-// CHECK-load: TestClassDecl.m:13:21: ParmDecl=arg:13:21 [Context=function] [Extent=13:21:13:23]
+// CHECK-load: TestClassDecl.m:10:12: ObjCInterfaceDecl=Foo:10:1 [Extent=10:1:11:4]
+// CHECK-load: TestClassDecl.m:13:6: FunctionDefn=function:13:6 [Extent=13:6:16:1]
+// CHECK-load: TestClassDecl.m:13:21: ParmDecl=arg:13:21 [Extent=13:21:13:23]
 

Modified: cfe/trunk/test/Index/TestClassForwardDecl.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/TestClassForwardDecl.m?rev=93760&r1=93759&r2=93760&view=diff

==============================================================================
--- cfe/trunk/test/Index/TestClassForwardDecl.m (original)
+++ cfe/trunk/test/Index/TestClassForwardDecl.m Mon Jan 18 14:23:29 2010
@@ -41,6 +41,6 @@
 
 
 
-// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDefn=function:10:6 [Context=TestClassForwardDecl.m]
-// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21 [Context=function]
+// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDefn=function:10:6
+// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21
 

Modified: cfe/trunk/test/Index/c-index-api-fn-scan.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/c-index-api-fn-scan.m?rev=93760&r1=93759&r2=93760&view=diff

==============================================================================
--- cfe/trunk/test/Index/c-index-api-fn-scan.m (original)
+++ cfe/trunk/test/Index/c-index-api-fn-scan.m Mon Jan 18 14:23:29 2010
@@ -91,127 +91,127 @@
   main(someEnum, (const char **)bee);
 }
 
-// CHECK: c-index-api-fn-scan.m:84:2: ObjCClassRef=Baz:48:1 [Context:Baz]
-// CHECK: c-index-api-fn-scan.m:84:3: ObjCClassRef=Baz:48:1 [Context:Baz]
-// CHECK: c-index-api-fn-scan.m:84:4: ObjCClassRef=Baz:48:1 [Context:Baz]
-// CHECK: c-index-api-fn-scan.m:84:6: VarDecl=bee:84:8 [Context:bee]
-// CHECK: c-index-api-fn-scan.m:84:8: VarDecl=bee:84:8 [Context:bee]
-// CHECK: c-index-api-fn-scan.m:84:9: VarDecl=bee:84:8 [Context:bee]
-// CHECK: c-index-api-fn-scan.m:84:10: VarDecl=bee:84:8 [Context:bee]
-// CHECK: <invalid loc>:85:2: TypedefDecl=id:0:0 [Context:id]
-// CHECK: <invalid loc>:85:3: TypedefDecl=id:0:0 [Context:id]
-// CHECK: c-index-api-fn-scan.m:85:5: VarDecl=a:85:5 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:6: VarDecl=a:85:5 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:7: VarDecl=a:85:5 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:8: VarDecl=a:85:5 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:9: ObjCSelectorRef=foo:24:1 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:10: VarRef=bee:84:8 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:11: VarRef=bee:84:8 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:12: VarRef=bee:84:8 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:13: ObjCSelectorRef=foo:24:1 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:14: ObjCSelectorRef=foo:24:1 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:15: ObjCSelectorRef=foo:24:1 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:16: ObjCSelectorRef=foo:24:1 [Context:a]
-// CHECK: c-index-api-fn-scan.m:85:17: ObjCSelectorRef=foo:24:1 [Context:a]
-// 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-fn-scan.m:86:5: VarDecl=c:86:12 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:6: ObjCProtocolRef=SubP:44:1 [Context:SubP]
-// CHECK: c-index-api-fn-scan.m:86:7: ObjCProtocolRef=SubP:44:1 [Context:SubP]
-// CHECK: c-index-api-fn-scan.m:86:8: ObjCProtocolRef=SubP:44:1 [Context:SubP]
-// CHECK: c-index-api-fn-scan.m:86:9: ObjCProtocolRef=SubP:44:1 [Context:SubP]
-// CHECK: c-index-api-fn-scan.m:86:10: VarDecl=c:86:12 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:12: VarDecl=c:86:12 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:13: VarDecl=c:86:12 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:14: VarDecl=c:86:12 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:15: VarDecl=c:86:12 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:16: ObjCSelectorRef=fooC:25:1 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:17: ObjCSelectorRef=fooC:25:1 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:18: ObjCSelectorRef=fooC:25:1 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:19: ObjCSelectorRef=fooC:25:1 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:20: ObjCSelectorRef=fooC:25:1 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:21: ObjCSelectorRef=fooC:25:1 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:22: ObjCSelectorRef=fooC:25:1 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:23: ObjCSelectorRef=fooC:25:1 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:24: ObjCSelectorRef=fooC:25:1 [Context:c]
-// CHECK: c-index-api-fn-scan.m:86:25: ObjCSelectorRef=fooC:25:1 [Context:c]
-// 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-fn-scan.m:87:5: VarDecl=d:87:13 [Context:d]
-// CHECK: c-index-api-fn-scan.m:87:6: ObjCProtocolRef=Proto:40:1 [Context:Proto]
-// CHECK: c-index-api-fn-scan.m:87:7: ObjCProtocolRef=Proto:40:1 [Context:Proto]
-// CHECK: c-index-api-fn-scan.m:87:8: ObjCProtocolRef=Proto:40:1 [Context:Proto]
-// CHECK: c-index-api-fn-scan.m:87:9: ObjCProtocolRef=Proto:40:1 [Context:Proto]
-// CHECK: c-index-api-fn-scan.m:87:10: ObjCProtocolRef=Proto:40:1 [Context:Proto]
-// CHECK: c-index-api-fn-scan.m:87:11: VarDecl=d:87:13 [Context:d]
-// CHECK: c-index-api-fn-scan.m:87:13: VarDecl=d:87:13 [Context:d]
-// CHECK: c-index-api-fn-scan.m:88:2: VarRef=d:87:13 [Context:main]
-// CHECK: c-index-api-fn-scan.m:88:6: VarRef=c:86:12 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:2: ObjCSelectorRef=pMethod:41:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:3: VarRef=d:87:13 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:4: ObjCSelectorRef=pMethod:41:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:5: ObjCSelectorRef=pMethod:41:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:6: ObjCSelectorRef=pMethod:41:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:7: ObjCSelectorRef=pMethod:41:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:8: ObjCSelectorRef=pMethod:41:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:9: ObjCSelectorRef=pMethod:41:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:10: ObjCSelectorRef=pMethod:41:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:11: ObjCSelectorRef=pMethod:41:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:89:12: ObjCSelectorRef=pMethod:41:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:2: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:3: VarRef=bee:84:8 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:4: VarRef=bee:84:8 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:5: VarRef=bee:84:8 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:6: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:7: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:8: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:9: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:10: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:11: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:12: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:13: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:14: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:15: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:16: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:17: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:18: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:19: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:20: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:21: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:22: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:23: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:24: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:25: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:26: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:27: VarRef=bee:84:8 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:28: VarRef=bee:84:8 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:29: VarRef=bee:84:8 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:30: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:31: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:32: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:33: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:34: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:35: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:36: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:37: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:38: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:39: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:40: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:41: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:42: ObjCSelectorRef=floatMethod:37:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:90:43: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:3: FunctionRef=main:83:5 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:4: FunctionRef=main:83:5 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:5: FunctionRef=main:83:5 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:6: FunctionRef=main:83:5 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:8: EnumConstantRef=someEnum:58:3 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:9: EnumConstantRef=someEnum:58:3 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:10: EnumConstantRef=someEnum:58:3 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:11: EnumConstantRef=someEnum:58:3 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:12: EnumConstantRef=someEnum:58:3 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:13: EnumConstantRef=someEnum:58:3 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:14: EnumConstantRef=someEnum:58:3 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:15: EnumConstantRef=someEnum:58:3 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:33: VarRef=bee:84:8 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:34: VarRef=bee:84:8 [Context:main]
-// CHECK: c-index-api-fn-scan.m:91:35: VarRef=bee:84:8 [Context:main]
+// CHECK: c-index-api-fn-scan.m:84:2: ObjCClassRef=Baz:48:1
+// CHECK: c-index-api-fn-scan.m:84:3: ObjCClassRef=Baz:48:1
+// CHECK: c-index-api-fn-scan.m:84:4: ObjCClassRef=Baz:48:1
+// CHECK: c-index-api-fn-scan.m:84:6: VarDecl=bee:84:8
+// CHECK: c-index-api-fn-scan.m:84:8: VarDecl=bee:84:8
+// CHECK: c-index-api-fn-scan.m:84:9: VarDecl=bee:84:8
+// CHECK: c-index-api-fn-scan.m:84:10: VarDecl=bee:84:8
+// CHECK: <invalid loc>:85:2: TypedefDecl=id:0:0
+// CHECK: <invalid loc>:85:3: TypedefDecl=id:0:0
+// CHECK: c-index-api-fn-scan.m:85:5: VarDecl=a:85:5
+// CHECK: c-index-api-fn-scan.m:85:6: VarDecl=a:85:5
+// CHECK: c-index-api-fn-scan.m:85:7: VarDecl=a:85:5
+// CHECK: c-index-api-fn-scan.m:85:8: VarDecl=a:85:5
+// CHECK: c-index-api-fn-scan.m:85:9: ObjCSelectorRef=foo:24:1
+// CHECK: c-index-api-fn-scan.m:85:10: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:85:11: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:85:12: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:85:13: ObjCSelectorRef=foo:24:1
+// CHECK: c-index-api-fn-scan.m:85:14: ObjCSelectorRef=foo:24:1
+// CHECK: c-index-api-fn-scan.m:85:15: ObjCSelectorRef=foo:24:1
+// CHECK: c-index-api-fn-scan.m:85:16: ObjCSelectorRef=foo:24:1
+// CHECK: c-index-api-fn-scan.m:85:17: ObjCSelectorRef=foo:24:1
+// CHECK: <invalid loc>:86:2: TypedefDecl=id:0:0
+// CHECK: <invalid loc>:86:3: TypedefDecl=id:0:0
+// CHECK: c-index-api-fn-scan.m:86:5: VarDecl=c:86:12
+// CHECK: c-index-api-fn-scan.m:86:6: ObjCProtocolRef=SubP:44:1
+// CHECK: c-index-api-fn-scan.m:86:7: ObjCProtocolRef=SubP:44:1
+// CHECK: c-index-api-fn-scan.m:86:8: ObjCProtocolRef=SubP:44:1
+// CHECK: c-index-api-fn-scan.m:86:9: ObjCProtocolRef=SubP:44:1
+// CHECK: c-index-api-fn-scan.m:86:10: VarDecl=c:86:12
+// CHECK: c-index-api-fn-scan.m:86:12: VarDecl=c:86:12
+// CHECK: c-index-api-fn-scan.m:86:13: VarDecl=c:86:12
+// CHECK: c-index-api-fn-scan.m:86:14: VarDecl=c:86:12
+// CHECK: c-index-api-fn-scan.m:86:15: VarDecl=c:86:12
+// CHECK: c-index-api-fn-scan.m:86:16: ObjCSelectorRef=fooC:25:1
+// CHECK: c-index-api-fn-scan.m:86:17: ObjCSelectorRef=fooC:25:1
+// CHECK: c-index-api-fn-scan.m:86:18: ObjCSelectorRef=fooC:25:1
+// CHECK: c-index-api-fn-scan.m:86:19: ObjCSelectorRef=fooC:25:1
+// CHECK: c-index-api-fn-scan.m:86:20: ObjCSelectorRef=fooC:25:1
+// CHECK: c-index-api-fn-scan.m:86:21: ObjCSelectorRef=fooC:25:1
+// CHECK: c-index-api-fn-scan.m:86:22: ObjCSelectorRef=fooC:25:1
+// CHECK: c-index-api-fn-scan.m:86:23: ObjCSelectorRef=fooC:25:1
+// CHECK: c-index-api-fn-scan.m:86:24: ObjCSelectorRef=fooC:25:1
+// CHECK: c-index-api-fn-scan.m:86:25: ObjCSelectorRef=fooC:25:1
+// CHECK: <invalid loc>:87:2: TypedefDecl=id:0:0
+// CHECK: <invalid loc>:87:3: TypedefDecl=id:0:0
+// CHECK: c-index-api-fn-scan.m:87:5: VarDecl=d:87:13
+// CHECK: c-index-api-fn-scan.m:87:6: ObjCProtocolRef=Proto:40:1
+// CHECK: c-index-api-fn-scan.m:87:7: ObjCProtocolRef=Proto:40:1
+// CHECK: c-index-api-fn-scan.m:87:8: ObjCProtocolRef=Proto:40:1
+// CHECK: c-index-api-fn-scan.m:87:9: ObjCProtocolRef=Proto:40:1
+// CHECK: c-index-api-fn-scan.m:87:10: ObjCProtocolRef=Proto:40:1
+// CHECK: c-index-api-fn-scan.m:87:11: VarDecl=d:87:13
+// CHECK: c-index-api-fn-scan.m:87:13: VarDecl=d:87:13
+// CHECK: c-index-api-fn-scan.m:88:2: VarRef=d:87:13
+// CHECK: c-index-api-fn-scan.m:88:6: VarRef=c:86:12
+// CHECK: c-index-api-fn-scan.m:89:2: ObjCSelectorRef=pMethod:41:1
+// CHECK: c-index-api-fn-scan.m:89:3: VarRef=d:87:13
+// CHECK: c-index-api-fn-scan.m:89:4: ObjCSelectorRef=pMethod:41:1
+// CHECK: c-index-api-fn-scan.m:89:5: ObjCSelectorRef=pMethod:41:1
+// CHECK: c-index-api-fn-scan.m:89:6: ObjCSelectorRef=pMethod:41:1
+// CHECK: c-index-api-fn-scan.m:89:7: ObjCSelectorRef=pMethod:41:1
+// CHECK: c-index-api-fn-scan.m:89:8: ObjCSelectorRef=pMethod:41:1
+// CHECK: c-index-api-fn-scan.m:89:9: ObjCSelectorRef=pMethod:41:1
+// CHECK: c-index-api-fn-scan.m:89:10: ObjCSelectorRef=pMethod:41:1
+// CHECK: c-index-api-fn-scan.m:89:11: ObjCSelectorRef=pMethod:41:1
+// CHECK: c-index-api-fn-scan.m:89:12: ObjCSelectorRef=pMethod:41:1
+// CHECK: c-index-api-fn-scan.m:90:2: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:3: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:90:4: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:90:5: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:90:6: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:7: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:8: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:9: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:10: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:11: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:12: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:13: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:14: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:15: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:16: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:17: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:18: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:19: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:20: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:21: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:22: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:23: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:24: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:25: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:90:26: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:27: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:90:28: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:90:29: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:90:30: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:31: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:32: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:33: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:34: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:35: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:36: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:37: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:38: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:39: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:40: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:41: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:42: ObjCSelectorRef=floatMethod:37:1
+// CHECK: c-index-api-fn-scan.m:90:43: ObjCSelectorRef=catMethodWithFloat::36:1
+// CHECK: c-index-api-fn-scan.m:91:3: FunctionRef=main:83:5
+// CHECK: c-index-api-fn-scan.m:91:4: FunctionRef=main:83:5
+// CHECK: c-index-api-fn-scan.m:91:5: FunctionRef=main:83:5
+// CHECK: c-index-api-fn-scan.m:91:6: FunctionRef=main:83:5
+// CHECK: c-index-api-fn-scan.m:91:8: EnumConstantRef=someEnum:58:3
+// CHECK: c-index-api-fn-scan.m:91:9: EnumConstantRef=someEnum:58:3
+// CHECK: c-index-api-fn-scan.m:91:10: EnumConstantRef=someEnum:58:3
+// CHECK: c-index-api-fn-scan.m:91:11: EnumConstantRef=someEnum:58:3
+// CHECK: c-index-api-fn-scan.m:91:12: EnumConstantRef=someEnum:58:3
+// CHECK: c-index-api-fn-scan.m:91:13: EnumConstantRef=someEnum:58:3
+// CHECK: c-index-api-fn-scan.m:91:14: EnumConstantRef=someEnum:58:3
+// CHECK: c-index-api-fn-scan.m:91:15: EnumConstantRef=someEnum:58:3
+// CHECK: c-index-api-fn-scan.m:91:33: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:91:34: VarRef=bee:84:8
+// CHECK: c-index-api-fn-scan.m:91:35: VarRef=bee:84:8

Modified: cfe/trunk/test/Index/c-index-api-loadTU-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/c-index-api-loadTU-test.m?rev=93760&r1=93759&r2=93760&view=diff

==============================================================================
--- cfe/trunk/test/Index/c-index-api-loadTU-test.m (original)
+++ cfe/trunk/test/Index/c-index-api-loadTU-test.m Mon Jan 18 14:23:29 2010
@@ -53,33 +53,33 @@
   main(someEnum, (const char **)bee);
 }
 
-// CHECK: c-index-api-loadTU-test.m:4:12: ObjCInterfaceDecl=Foo:4:1 [Context=c-index-api-loadTU-test.m] [Extent=4:1:11:4]
-// CHECK: c-index-api-loadTU-test.m:8:1: ObjCInstanceMethodDecl=foo:8:1 [Context=Foo] [Extent=8:1:8:6]
-// CHECK: c-index-api-loadTU-test.m:9:1: ObjCClassMethodDecl=fooC:9:1 [Context=Foo] [Extent=9:1:9:7]
-// CHECK: c-index-api-loadTU-test.m:13:12: ObjCInterfaceDecl=Bar:13:1 [Context=c-index-api-loadTU-test.m] [Extent=13:1:17:4]
-// CHECK: c-index-api-loadTU-test.m:13:18: ObjCSuperClassRef=Foo:4:1 [Context=Bar] [Extent=4:1:11:4]
-// CHECK: c-index-api-loadTU-test.m:19:12: ObjCCategoryDecl=FooCat:19:12 [Context=c-index-api-loadTU-test.m] [Extent=19:1:22:4]
-// CHECK: c-index-api-loadTU-test.m:19:12: ObjCClassRef=Foo:4:1 [Context=FooCat] [Extent=4:1:11:4]
-// CHECK: c-index-api-loadTU-test.m:20:1: ObjCInstanceMethodDecl=catMethodWithFloat::20:1 [Context=FooCat] [Extent=20:1:20:40]
-// CHECK: c-index-api-loadTU-test.m:21:1: ObjCInstanceMethodDecl=floatMethod:21:1 [Context=FooCat] [Extent=21:1:21:22]
-// CHECK: c-index-api-loadTU-test.m:24:1: ObjCProtocolDecl=Proto:24:1 [Context=c-index-api-loadTU-test.m] [Extent=24:1:26:4]
-// CHECK: c-index-api-loadTU-test.m:25:1: ObjCInstanceMethodDecl=pMethod:25:1 [Context=Proto] [Extent=25:1:25:10]
-// CHECK: c-index-api-loadTU-test.m:28:1: ObjCProtocolDecl=SubP:28:1 [Context=c-index-api-loadTU-test.m] [Extent=28:1:30:4]
-// CHECK: c-index-api-loadTU-test.m:28:17: ObjCProtocolRef=Proto:24:1 [Context=SubP] [Extent=24:1:26:4]
-// CHECK: c-index-api-loadTU-test.m:29:1: ObjCInstanceMethodDecl=spMethod:29:1 [Context=SubP] [Extent=29:1:29:11]
-// CHECK: c-index-api-loadTU-test.m:32:12: ObjCInterfaceDecl=Baz:32:1 [Context=c-index-api-loadTU-test.m] [Extent=32:1:39:4]
-// CHECK: c-index-api-loadTU-test.m:32:18: ObjCSuperClassRef=Bar:13:1 [Context=Baz] [Extent=13:1:17:4]
-// CHECK: c-index-api-loadTU-test.m:32:23: ObjCProtocolRef=SubP:28:1 [Context=Baz] [Extent=28:1:30:4]
-// CHECK: c-index-api-loadTU-test.m:34:9: ObjCIvarDecl=_anIVar:34:9 [Context=Baz] [Extent=34:9:34:15]
-// CHECK: c-index-api-loadTU-test.m:37:1: ObjCInstanceMethodDecl=bazMethod:37:1 [Context=Baz] [Extent=37:1:37:20]
-// CHECK: c-index-api-loadTU-test.m:41:1: EnumDecl=:41:1 [Context=c-index-api-loadTU-test.m] [Extent=41:1:43:1]
-// CHECK: c-index-api-loadTU-test.m:42:3: EnumConstantDecl=someEnum:42:3 [Context=] [Extent=42:3:42:10]
-// CHECK: c-index-api-loadTU-test.m:45:5: FunctionDefn=main:45:5 [Context=c-index-api-loadTU-test.m] [Extent=45:5:54:1]
-// CHECK: c-index-api-loadTU-test.m:45:15: ParmDecl=argc:45:15 [Context=main] [Extent=45:15:45:18]
-// CHECK: c-index-api-loadTU-test.m:45:34: ParmDecl=argv:45:34 [Context=main] [Extent=45:34:45:37]
-// CHECK: c-index-api-loadTU-test.m:46:8: VarDecl=bee:46:8 [Context=main] [Extent=46:8:46:10]
-// CHECK: c-index-api-loadTU-test.m:47:5: VarDecl=a:47:5 [Context=main] [Extent=47:5:47:17]
-// CHECK: c-index-api-loadTU-test.m:48:12: VarDecl=c:48:12 [Context=main] [Extent=48:12:48:25]
-// CHECK: c-index-api-loadTU-test.m:49:13: VarDecl=d:49:13 [Context=main] [Extent=49:13:49:13]
+// CHECK: c-index-api-loadTU-test.m:4:12: ObjCInterfaceDecl=Foo:4:1 [Extent=4:1:11:4]
+// CHECK: c-index-api-loadTU-test.m:8:1: ObjCInstanceMethodDecl=foo:8:1 [Extent=8:1:8:6]
+// CHECK: c-index-api-loadTU-test.m:9:1: ObjCClassMethodDecl=fooC:9:1 [Extent=9:1:9:7]
+// CHECK: c-index-api-loadTU-test.m:13:12: ObjCInterfaceDecl=Bar:13:1 [Extent=13:1:17:4]
+// CHECK: c-index-api-loadTU-test.m:13:18: ObjCSuperClassRef=Foo:4:1 [Extent=4:1:11:4]
+// CHECK: c-index-api-loadTU-test.m:19:12: ObjCCategoryDecl=FooCat:19:12 [Extent=19:1:22:4]
+// CHECK: c-index-api-loadTU-test.m:19:12: ObjCClassRef=Foo:4:1 [Extent=4:1:11:4]
+// CHECK: c-index-api-loadTU-test.m:20:1: ObjCInstanceMethodDecl=catMethodWithFloat::20:1 [Extent=20:1:20:40]
+// CHECK: c-index-api-loadTU-test.m:21:1: ObjCInstanceMethodDecl=floatMethod:21:1 [Extent=21:1:21:22]
+// CHECK: c-index-api-loadTU-test.m:24:1: ObjCProtocolDecl=Proto:24:1 [Extent=24:1:26:4]
+// CHECK: c-index-api-loadTU-test.m:25:1: ObjCInstanceMethodDecl=pMethod:25:1 [Extent=25:1:25:10]
+// CHECK: c-index-api-loadTU-test.m:28:1: ObjCProtocolDecl=SubP:28:1 [Extent=28:1:30:4]
+// CHECK: c-index-api-loadTU-test.m:28:17: ObjCProtocolRef=Proto:24:1 [Extent=24:1:26:4]
+// CHECK: c-index-api-loadTU-test.m:29:1: ObjCInstanceMethodDecl=spMethod:29:1 [Extent=29:1:29:11]
+// CHECK: c-index-api-loadTU-test.m:32:12: ObjCInterfaceDecl=Baz:32:1 [Extent=32:1:39:4]
+// CHECK: c-index-api-loadTU-test.m:32:18: ObjCSuperClassRef=Bar:13:1 [Extent=13:1:17:4]
+// CHECK: c-index-api-loadTU-test.m:32:23: ObjCProtocolRef=SubP:28:1 [Extent=28:1:30:4]
+// CHECK: c-index-api-loadTU-test.m:34:9: ObjCIvarDecl=_anIVar:34:9 [Extent=34:9:34:15]
+// CHECK: c-index-api-loadTU-test.m:37:1: ObjCInstanceMethodDecl=bazMethod:37:1 [Extent=37:1:37:20]
+// CHECK: c-index-api-loadTU-test.m:41:1: EnumDecl=:41:1 [Extent=41:1:43:1]
+// CHECK: c-index-api-loadTU-test.m:42:3: EnumConstantDecl=someEnum:42:3 [Extent=42:3:42:10]
+// CHECK: c-index-api-loadTU-test.m:45:5: FunctionDefn=main:45:5 [Extent=45:5:54:1]
+// CHECK: c-index-api-loadTU-test.m:45:15: ParmDecl=argc:45:15 [Extent=45:15:45:18]
+// CHECK: c-index-api-loadTU-test.m:45:34: ParmDecl=argv:45:34 [Extent=45:34:45:37]
+// CHECK: c-index-api-loadTU-test.m:46:8: VarDecl=bee:46:8 [Extent=46:8:46:10]
+// CHECK: c-index-api-loadTU-test.m:47:5: VarDecl=a:47:5 [Extent=47:5:47:17]
+// CHECK: c-index-api-loadTU-test.m:48:12: VarDecl=c:48:12 [Extent=48:12:48:25]
+// CHECK: c-index-api-loadTU-test.m:49:13: VarDecl=d:49:13 [Extent=49:13:49:13]
 
 

Modified: cfe/trunk/test/Index/cindex-from-source.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/cindex-from-source.m?rev=93760&r1=93759&r2=93760&view=diff

==============================================================================
--- cfe/trunk/test/Index/cindex-from-source.m (original)
+++ cfe/trunk/test/Index/cindex-from-source.m Mon Jan 18 14:23:29 2010
@@ -2,8 +2,8 @@
 // RUN: %clang -x objective-c-header %t.pfx.h -o %t.pfx.h.gch
 // RUN: c-index-test -test-load-source local %s -include %t.pfx.h > %t
 // RUN: FileCheck %s < %t
-// CHECK: cindex-from-source.m:{{.*}}:{{.*}}: StructDecl=s0:{{.*}}:{{.*}} [Context=cindex-from-source.m]
-// CHECK: cindex-from-source.m:{{.*}}:{{.*}}: VarDecl=g0:{{.*}}:{{.*}} [Context=cindex-from-source.m]
+// CHECK: cindex-from-source.m:{{.*}}:{{.*}}: StructDecl=s0:{{.*}}:{{.*}}
+// CHECK: cindex-from-source.m:{{.*}}:{{.*}}: VarDecl=g0:{{.*}}:{{.*}}
 
 struct s0 {};
 t0 g0;

Modified: cfe/trunk/tools/CIndex/CIndex.exports
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.exports?rev=93760&r1=93759&r2=93760&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.exports (original)
+++ cfe/trunk/tools/CIndex/CIndex.exports Mon Jan 18 14:23:29 2010
@@ -21,14 +21,14 @@
 _clang_getCursorSource
 _clang_getCursorSourceFile
 _clang_getCursorSpelling
+_clang_getCursorUSR
 _clang_getDeclColumn
 _clang_getDeclExtent
-_clang_getDeclLine
 _clang_getDeclExtent
+_clang_getDeclLine
 _clang_getDeclSource
 _clang_getDeclSourceFile
 _clang_getDeclSpelling
-_clang_getDeclUSR
 _clang_getDeclaration
 _clang_getDefinitionSpellingAndExtent
 _clang_getEntityFromDecl

Modified: cfe/trunk/tools/CIndex/CIndexUSRs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndexUSRs.cpp?rev=93760&r1=93759&r2=93760&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndexUSRs.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndexUSRs.cpp Mon Jan 18 14:23:29 2010
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "CIndexer.h"
+#include "CXCursor.h"
 #include "clang/AST/DeclVisitor.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/raw_ostream.h"
@@ -184,6 +185,23 @@
   Out << "typedef@" << D->getName();
 }
 
+// FIXME: This is a skeleton implementation.  It will be overhauled.
+static CXString ConstructUSR(Decl *D) {
+  llvm::SmallString<1024> StrBuf;
+  {
+    llvm::raw_svector_ostream Out(StrBuf);
+    USRGenerator UG(Out);
+    UG.Visit(static_cast<Decl*>(D));
+  }
+  
+  if (StrBuf.empty())
+    return CIndexer::createCXString(NULL);
+  
+  // Return a copy of the string that must be disposed by the caller.
+  return CIndexer::createCXString(StrBuf.c_str(), true);
+}  
+
+
 extern "C" {
 
 /// clang_getDeclaration() maps from a CXEntity to the matching CXDecl (if any)
@@ -198,22 +216,13 @@
     return MakeEntity(CIdx, Entity::get(D, GetProgram(CIdx)));
   return NullCXEntity();
 }
-    
-// FIXME: This is a skeleton implementation.  It will be overhauled.
-CXString clang_getDeclUSR(CXDecl D) {
-  assert(D && "Null CXDecl passed to clang_getDeclUSR()");
-  llvm::SmallString<1024> StrBuf;
-  {
-    llvm::raw_svector_ostream Out(StrBuf);
-    USRGenerator UG(Out);
-    UG.Visit(static_cast<Decl*>(D));
-  }
-  
-  if (StrBuf.empty())
-    return CIndexer::createCXString(NULL);
 
-  // Return a copy of the string that must be disposed by the caller.
-  return CIndexer::createCXString(StrBuf.c_str(), true);
-}  
+CXString clang_getCursorUSR(CXCursor C) {
+  if (Decl *D = cxcursor::getCursorDecl(C))
+    return ConstructUSR(D);
+  
+  
+  return CIndexer::createCXString(NULL);
+}
 
 } // end extern "C"

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=93760&r1=93759&r2=93760&view=diff

==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Mon Jan 18 14:23:29 2010
@@ -84,17 +84,11 @@
 
 static void DeclVisitor(CXDecl Dcl, CXCursor Cursor, CXClientData Filter) {
   if (!Filter || (Cursor.kind == *(enum CXCursorKind *)Filter)) {
-    CXString string;
     printf("// %s: %s:%d:%d: ", FileCheckPrefix,
                                 GetCursorSource(Cursor),
                                 clang_getCursorLine(Cursor),
                                 clang_getCursorColumn(Cursor));
-    PrintCursor(Cursor);
-
-    string = clang_getDeclSpelling(Dcl);
-    printf(" [Context=%s]", clang_getCString(string));
-    clang_disposeString(string);
-    
+    PrintCursor(Cursor);    
     PrintDeclExtent(clang_getCursorDecl(Cursor));
 
     printf("\n");
@@ -105,15 +99,10 @@
                                    CXClientData Filter) {
   if (!Filter || (Cursor.kind == *(enum CXCursorKind *)Filter)) {
     CXDecl D;
-    CXString string;
     printf("// %s: %s:%d:%d: ", FileCheckPrefix,
            GetCursorSource(Cursor), clang_getCursorLine(Cursor),
            clang_getCursorColumn(Cursor));
     PrintCursor(Cursor);
-    string = clang_getTranslationUnitSpelling(Unit);
-    printf(" [Context=%s]",
-          basename(clang_getCString(string)));
-    clang_disposeString(string);
     
     D = clang_getCursorDecl(Cursor);
     if (!D) {
@@ -156,13 +145,10 @@
     if (Ref.kind == CXCursor_NoDeclFound) {
       /* Nothing found here; that's fine. */
     } else if (Ref.kind != CXCursor_FunctionDecl) {
-      CXString string;
       printf("// %s: %s:%d:%d: ", FileCheckPrefix, GetCursorSource(Ref),
              curLine, curColumn);
       PrintCursor(Ref);
-      string = clang_getDeclSpelling(Ref.data[0]);
-      printf(" [Context:%s]\n", clang_getCString(string));
-      clang_disposeString(string);
+      printf("\n");
     }
     startBuf++;
   }
@@ -174,13 +160,13 @@
 
 static void USRDeclVisitor(CXDecl D, CXCursor C, CXClientData Filter) {
   if (!Filter || (C.kind == *(enum CXCursorKind *)Filter)) {
-    CXString USR = clang_getDeclUSR(C.data[0]);
+    CXString USR = clang_getCursorUSR(C);
     if (!USR.Spelling) {
       clang_disposeString(USR);
       return;
     }
     printf("// %s: %s %s", FileCheckPrefix, GetCursorSource(C), USR.Spelling);
-    PrintDeclExtent(C.data[0]);
+    PrintDeclExtent(clang_getCursorDecl(C));
     printf("\n");
     clang_disposeString(USR);
   }





More information about the cfe-commits mailing list