diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c index b46e3842a0d6..3bfdeeed2a57 100644 --- a/clang/tools/c-index-test/c-index-test.c +++ b/clang/tools/c-index-test/c-index-test.c @@ -340,7 +340,7 @@ static const char* GetCursorSource(CXCursor Cursor) { CXSourceLocation Loc = clang_getCursorLocation(Cursor); CXString source; CXFile file; - clang_getSpellingLocation(Loc, &file, 0, 0, 0); + clang_getExpansionLocation(Loc, &file, 0, 0, 0); source = clang_getFileName(file); if (!clang_getCString(source)) { clang_disposeString(source); diff --git a/clang/tools/libclang/CXSourceLocation.cpp b/clang/tools/libclang/CXSourceLocation.cpp index 71383445c57f..d8d4c96e48d3 100644 --- a/clang/tools/libclang/CXSourceLocation.cpp +++ b/clang/tools/libclang/CXSourceLocation.cpp @@ -212,6 +212,7 @@ void clang_getExpansionLocation(CXSourceLocation location, *column = SM.getExpansionColumnNumber(ExpansionLoc); if (offset) *offset = SM.getDecomposedLoc(ExpansionLoc).second; + return; } // FIXME: