@@ -464,10 +464,10 @@ static void PrintRange(CXSourceRange R, const char *str) {
464
464
CXFile begin_file , end_file ;
465
465
unsigned begin_line , begin_column , end_line , end_column ;
466
466
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 );
471
471
if (!begin_file || !end_file )
472
472
return ;
473
473
@@ -849,13 +849,13 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
849
849
printf (", " );
850
850
851
851
Loc = clang_getCursorLocation (Ovl );
852
- clang_getSpellingLocation (Loc , 0 , & line , & column , 0 );
852
+ clang_getFileLocation (Loc , 0 , & line , & column , 0 );
853
853
printf ("%d:%d" , line , column );
854
854
}
855
855
printf ("]" );
856
856
} else {
857
857
CXSourceLocation Loc = clang_getCursorLocation (Referenced );
858
- clang_getSpellingLocation (Loc , 0 , & line , & column , 0 );
858
+ clang_getFileLocation (Loc , 0 , & line , & column , 0 );
859
859
printf (":%d:%d" , line , column );
860
860
}
861
861
@@ -1047,7 +1047,7 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
1047
1047
if (!clang_equalCursors (SpecializationOf , clang_getNullCursor ())) {
1048
1048
CXSourceLocation Loc = clang_getCursorLocation (SpecializationOf );
1049
1049
CXString Name = clang_getCursorSpelling (SpecializationOf );
1050
- clang_getSpellingLocation (Loc , 0 , & line , & column , 0 );
1050
+ clang_getFileLocation (Loc , 0 , & line , & column , 0 );
1051
1051
printf (" [Specialization of %s:%d:%d]" ,
1052
1052
clang_getCString (Name ), line , column );
1053
1053
clang_disposeString (Name );
@@ -1094,7 +1094,7 @@ static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
1094
1094
printf (" [Overrides " );
1095
1095
for (I = 0 ; I != num_overridden ; ++ I ) {
1096
1096
CXSourceLocation Loc = clang_getCursorLocation (overridden [I ]);
1097
- clang_getSpellingLocation (Loc , 0 , & line , & column , 0 );
1097
+ clang_getFileLocation (Loc , 0 , & line , & column , 0 );
1098
1098
lineCols [I ].line = line ;
1099
1099
lineCols [I ].col = column ;
1100
1100
}
@@ -1257,8 +1257,8 @@ void PrintDiagnostic(CXDiagnostic Diagnostic) {
1257
1257
fprintf (stderr , "%s\n" , clang_getCString (Msg ));
1258
1258
clang_disposeString (Msg );
1259
1259
1260
- clang_getSpellingLocation (clang_getDiagnosticLocation (Diagnostic ),
1261
- & file , 0 , 0 , 0 );
1260
+ clang_getFileLocation (clang_getDiagnosticLocation (Diagnostic ), & file , 0 , 0 ,
1261
+ 0 );
1262
1262
if (!file )
1263
1263
return ;
1264
1264
@@ -1271,9 +1271,8 @@ void PrintDiagnostic(CXDiagnostic Diagnostic) {
1271
1271
CXSourceLocation end = clang_getRangeEnd (range );
1272
1272
unsigned start_line , start_column , end_line , end_column ;
1273
1273
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 );
1277
1276
if (clang_equalLocations (start , end )) {
1278
1277
/* Insertion. */
1279
1278
if (start_file == file )
@@ -1356,7 +1355,7 @@ enum CXChildVisitResult FilteredPrintingVisitor(CXCursor Cursor,
1356
1355
if (!Data -> Filter || (Cursor .kind == * (enum CXCursorKind * )Data -> Filter )) {
1357
1356
CXSourceLocation Loc = clang_getCursorLocation (Cursor );
1358
1357
unsigned line , column ;
1359
- clang_getSpellingLocation (Loc , 0 , & line , & column , 0 );
1358
+ clang_getFileLocation (Loc , 0 , & line , & column , 0 );
1360
1359
printf ("// %s: %s:%d:%d: " , FileCheckPrefix ,
1361
1360
GetCursorSource (Cursor ), line , column );
1362
1361
PrintCursor (Cursor , Data -> CommentSchemaFile );
@@ -1417,7 +1416,7 @@ static enum CXChildVisitResult FunctionScanVisitor(CXCursor Cursor,
1417
1416
curColumn ++ ;
1418
1417
1419
1418
Loc = clang_getCursorLocation (Cursor );
1420
- clang_getSpellingLocation (Loc , & file , 0 , 0 , 0 );
1419
+ clang_getFileLocation (Loc , & file , 0 , 0 , 0 );
1421
1420
1422
1421
source = clang_getFileName (file );
1423
1422
if (clang_getCString (source )) {
@@ -1483,8 +1482,7 @@ void InclusionVisitor(CXFile includedFile, CXSourceLocation *includeStack,
1483
1482
for (i = 0 ; i < includeStackLen ; ++ i ) {
1484
1483
CXFile includingFile ;
1485
1484
unsigned line , column ;
1486
- clang_getSpellingLocation (includeStack [i ], & includingFile , & line ,
1487
- & column , 0 );
1485
+ clang_getFileLocation (includeStack [i ], & includingFile , & line , & column , 0 );
1488
1486
fname = clang_getFileName (includingFile );
1489
1487
printf (" %s:%d:%d\n" , clang_getCString (fname ), line , column );
1490
1488
clang_disposeString (fname );
@@ -2984,7 +2982,7 @@ static void inspect_print_cursor(CXCursor Cursor) {
2984
2982
CXString Spelling ;
2985
2983
const char * cspell ;
2986
2984
unsigned line , column ;
2987
- clang_getSpellingLocation (CursorLoc , 0 , & line , & column , 0 );
2985
+ clang_getFileLocation (CursorLoc , 0 , & line , & column , 0 );
2988
2986
printf ("%d:%d " , line , column );
2989
2987
PrintCursor (Cursor , NULL );
2990
2988
PrintCursorExtent (Cursor );
@@ -3100,7 +3098,7 @@ static void inspect_evaluate_cursor(CXCursor Cursor) {
3100
3098
unsigned line , column ;
3101
3099
CXEvalResult ER ;
3102
3100
3103
- clang_getSpellingLocation (CursorLoc , 0 , & line , & column , 0 );
3101
+ clang_getFileLocation (CursorLoc , 0 , & line , & column , 0 );
3104
3102
printf ("%d:%d " , line , column );
3105
3103
PrintCursor (Cursor , NULL );
3106
3104
PrintCursorExtent (Cursor );
@@ -3135,7 +3133,7 @@ static void inspect_macroinfo_cursor(CXCursor Cursor) {
3135
3133
CXString Spelling ;
3136
3134
const char * cspell ;
3137
3135
unsigned line , column ;
3138
- clang_getSpellingLocation (CursorLoc , 0 , & line , & column , 0 );
3136
+ clang_getFileLocation (CursorLoc , 0 , & line , & column , 0 );
3139
3137
printf ("%d:%d " , line , column );
3140
3138
PrintCursor (Cursor , NULL );
3141
3139
PrintCursorExtent (Cursor );
@@ -4328,10 +4326,10 @@ int perform_token_annotation(int argc, const char **argv) {
4328
4326
skipped_ranges = clang_getSkippedRanges (TU , file );
4329
4327
for (i = 0 ; i != skipped_ranges -> count ; ++ i ) {
4330
4328
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 );
4335
4333
printf ("Skipping: " );
4336
4334
PrintExtent (stdout , start_line , start_column , end_line , end_column );
4337
4335
printf ("\n" );
@@ -4351,10 +4349,10 @@ int perform_token_annotation(int argc, const char **argv) {
4351
4349
case CXToken_Literal : kind = "Literal" ; break ;
4352
4350
case CXToken_Comment : kind = "Comment" ; break ;
4353
4351
}
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 );
4358
4356
printf ("%s: \"%s\" " , kind , clang_getCString (spelling ));
4359
4357
clang_disposeString (spelling );
4360
4358
PrintExtent (stdout , start_line , start_column , end_line , end_column );
0 commit comments