@@ -464,10 +464,10 @@ static void PrintRange(CXSourceRange R, const char *str) {
464464 CXFile begin_file , end_file ;
465465 unsigned begin_line , begin_column , end_line , end_column ;
466466
467- clang_getSpellingLocation (clang_getRangeStart (R ),
468- & begin_file , & begin_line , & begin_column , 0 );
469- clang_getSpellingLocation (clang_getRangeEnd (R ),
470- & end_file , & end_line , & end_column , 0 );
467+ clang_getFileLocation (clang_getRangeStart (R ), & begin_file , & begin_line ,
468+ & begin_column , 0 );
469+ clang_getFileLocation (clang_getRangeEnd (R ), & end_file , & end_line , & end_column ,
470+ 0 );
471471 if (!begin_file || !end_file )
472472 return ;
473473
@@ -849,13 +849,13 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
849849 printf (", " );
850850
851851 Loc = clang_getCursorLocation (Ovl );
852- clang_getSpellingLocation (Loc , 0 , & line , & column , 0 );
852+ clang_getFileLocation (Loc , 0 , & line , & column , 0 );
853853 printf ("%d:%d" , line , column );
854854 }
855855 printf ("]" );
856856 } else {
857857 CXSourceLocation Loc = clang_getCursorLocation (Referenced );
858- clang_getSpellingLocation (Loc , 0 , & line , & column , 0 );
858+ clang_getFileLocation (Loc , 0 , & line , & column , 0 );
859859 printf (":%d:%d" , line , column );
860860 }
861861
@@ -1047,7 +1047,7 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
10471047 if (!clang_equalCursors (SpecializationOf , clang_getNullCursor ())) {
10481048 CXSourceLocation Loc = clang_getCursorLocation (SpecializationOf );
10491049 CXString Name = clang_getCursorSpelling (SpecializationOf );
1050- clang_getSpellingLocation (Loc , 0 , & line , & column , 0 );
1050+ clang_getFileLocation (Loc , 0 , & line , & column , 0 );
10511051 printf (" [Specialization of %s:%d:%d]" ,
10521052 clang_getCString (Name ), line , column );
10531053 clang_disposeString (Name );
@@ -1094,7 +1094,7 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
10941094 printf (" [Overrides " );
10951095 for (I = 0 ; I != num_overridden ; ++ I ) {
10961096 CXSourceLocation Loc = clang_getCursorLocation (overridden [I ]);
1097- clang_getSpellingLocation (Loc , 0 , & line , & column , 0 );
1097+ clang_getFileLocation (Loc , 0 , & line , & column , 0 );
10981098 lineCols [I ].line = line ;
10991099 lineCols [I ].col = column ;
11001100 }
@@ -1257,8 +1257,8 @@ void PrintDiagnostic(CXDiagnostic Diagnostic) {
12571257 fprintf (stderr , "%s\n" , clang_getCString (Msg ));
12581258 clang_disposeString (Msg );
12591259
1260- clang_getSpellingLocation (clang_getDiagnosticLocation (Diagnostic ),
1261- & file , 0 , 0 , 0 );
1260+ clang_getFileLocation (clang_getDiagnosticLocation (Diagnostic ), & file , 0 , 0 ,
1261+ 0 );
12621262 if (!file )
12631263 return ;
12641264
@@ -1271,9 +1271,8 @@ void PrintDiagnostic(CXDiagnostic Diagnostic) {
12711271 CXSourceLocation end = clang_getRangeEnd (range );
12721272 unsigned start_line , start_column , end_line , end_column ;
12731273 CXFile start_file , end_file ;
1274- clang_getSpellingLocation (start , & start_file , & start_line ,
1275- & start_column , 0 );
1276- clang_getSpellingLocation (end , & end_file , & end_line , & end_column , 0 );
1274+ clang_getFileLocation (start , & start_file , & start_line , & start_column , 0 );
1275+ clang_getFileLocation (end , & end_file , & end_line , & end_column , 0 );
12771276 if (clang_equalLocations (start , end )) {
12781277 /* Insertion. */
12791278 if (start_file == file )
@@ -1356,7 +1355,7 @@ enum CXChildVisitResult FilteredPrintingVisitor(CXCursor Cursor,
13561355 if (!Data -> Filter || (Cursor .kind == * (enum CXCursorKind * )Data -> Filter )) {
13571356 CXSourceLocation Loc = clang_getCursorLocation (Cursor );
13581357 unsigned line , column ;
1359- clang_getSpellingLocation (Loc , 0 , & line , & column , 0 );
1358+ clang_getFileLocation (Loc , 0 , & line , & column , 0 );
13601359 printf ("// %s: %s:%d:%d: " , FileCheckPrefix ,
13611360 GetCursorSource (Cursor ), line , column );
13621361 PrintCursor (Cursor , Data -> CommentSchemaFile );
@@ -1417,7 +1416,7 @@ static enum CXChildVisitResult FunctionScanVisitor(CXCursor Cursor,
14171416 curColumn ++ ;
14181417
14191418 Loc = clang_getCursorLocation (Cursor );
1420- clang_getSpellingLocation (Loc , & file , 0 , 0 , 0 );
1419+ clang_getFileLocation (Loc , & file , 0 , 0 , 0 );
14211420
14221421 source = clang_getFileName (file );
14231422 if (clang_getCString (source )) {
@@ -1483,8 +1482,7 @@ void InclusionVisitor(CXFile includedFile, CXSourceLocation *includeStack,
14831482 for (i = 0 ; i < includeStackLen ; ++ i ) {
14841483 CXFile includingFile ;
14851484 unsigned line , column ;
1486- clang_getSpellingLocation (includeStack [i ], & includingFile , & line ,
1487- & column , 0 );
1485+ clang_getFileLocation (includeStack [i ], & includingFile , & line , & column , 0 );
14881486 fname = clang_getFileName (includingFile );
14891487 printf (" %s:%d:%d\n" , clang_getCString (fname ), line , column );
14901488 clang_disposeString (fname );
@@ -2984,7 +2982,7 @@ static void inspect_print_cursor(CXCursor Cursor) {
29842982 CXString Spelling ;
29852983 const char * cspell ;
29862984 unsigned line , column ;
2987- clang_getSpellingLocation (CursorLoc , 0 , & line , & column , 0 );
2985+ clang_getFileLocation (CursorLoc , 0 , & line , & column , 0 );
29882986 printf ("%d:%d " , line , column );
29892987 PrintCursor (Cursor , NULL );
29902988 PrintCursorExtent (Cursor );
@@ -3100,7 +3098,7 @@ static void inspect_evaluate_cursor(CXCursor Cursor) {
31003098 unsigned line , column ;
31013099 CXEvalResult ER ;
31023100
3103- clang_getSpellingLocation (CursorLoc , 0 , & line , & column , 0 );
3101+ clang_getFileLocation (CursorLoc , 0 , & line , & column , 0 );
31043102 printf ("%d:%d " , line , column );
31053103 PrintCursor (Cursor , NULL );
31063104 PrintCursorExtent (Cursor );
@@ -3135,7 +3133,7 @@ static void inspect_macroinfo_cursor(CXCursor Cursor) {
31353133 CXString Spelling ;
31363134 const char * cspell ;
31373135 unsigned line , column ;
3138- clang_getSpellingLocation (CursorLoc , 0 , & line , & column , 0 );
3136+ clang_getFileLocation (CursorLoc , 0 , & line , & column , 0 );
31393137 printf ("%d:%d " , line , column );
31403138 PrintCursor (Cursor , NULL );
31413139 PrintCursorExtent (Cursor );
@@ -4328,10 +4326,10 @@ int perform_token_annotation(int argc, const char **argv) {
43284326 skipped_ranges = clang_getSkippedRanges (TU , file );
43294327 for (i = 0 ; i != skipped_ranges -> count ; ++ i ) {
43304328 unsigned start_line , start_column , end_line , end_column ;
4331- clang_getSpellingLocation (clang_getRangeStart (skipped_ranges -> ranges [i ]),
4332- 0 , & start_line , & start_column , 0 );
4333- clang_getSpellingLocation (clang_getRangeEnd (skipped_ranges -> ranges [i ]),
4334- 0 , & end_line , & end_column , 0 );
4329+ clang_getFileLocation (clang_getRangeStart (skipped_ranges -> ranges [i ]), 0 ,
4330+ & start_line , & start_column , 0 );
4331+ clang_getFileLocation (clang_getRangeEnd (skipped_ranges -> ranges [i ]), 0 ,
4332+ & end_line , & end_column , 0 );
43354333 printf ("Skipping: " );
43364334 PrintExtent (stdout , start_line , start_column , end_line , end_column );
43374335 printf ("\n" );
@@ -4351,10 +4349,10 @@ int perform_token_annotation(int argc, const char **argv) {
43514349 case CXToken_Literal : kind = "Literal" ; break ;
43524350 case CXToken_Comment : kind = "Comment" ; break ;
43534351 }
4354- clang_getSpellingLocation (clang_getRangeStart (extent ),
4355- 0 , & start_line , & start_column , 0 );
4356- clang_getSpellingLocation (clang_getRangeEnd (extent ),
4357- 0 , & end_line , & end_column , 0 );
4352+ clang_getFileLocation (clang_getRangeStart (extent ), 0 , & start_line ,
4353+ & start_column , 0 );
4354+ clang_getFileLocation (clang_getRangeEnd (extent ), 0 , & end_line , & end_column ,
4355+ 0 );
43584356 printf ("%s: \"%s\" " , kind , clang_getCString (spelling ));
43594357 clang_disposeString (spelling );
43604358 PrintExtent (stdout , start_line , start_column , end_line , end_column );
0 commit comments