[libclang] Add missing return in clang_getExpansionLocation that resulted in that function

always returning a null file/line/column.

Also add at least one use of clang_getExpansionLocation inside c-index-test that would have
made the tests to catch that.

llvm-svn: 143606
This commit is contained in:
Argyrios Kyrtzidis 2011-11-03 02:20:36 +00:00
parent e968152564
commit 7ca77357ce
2 changed files with 2 additions and 1 deletions

View File

@ -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);

View File

@ -212,6 +212,7 @@ void clang_getExpansionLocation(CXSourceLocation location,
*column = SM.getExpansionColumnNumber(ExpansionLoc);
if (offset)
*offset = SM.getDecomposedLoc(ExpansionLoc).second;
return;
}
// FIXME: