aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-03 02:20:36 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-03 02:20:36 +0000
commitb4efaa0a14dd2382aa028c03283b5a7f5345e24d (patch)
tree788353ee92fb19f82a1b17978c89cd4a9de48ab6
parentdfb332d0081c6641d1dbae6a2aeff757c99cc740 (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143606 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/c-index-test/c-index-test.c2
-rw-r--r--tools/libclang/CXSourceLocation.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index b46e3842a0..3bfdeeed2a 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/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/tools/libclang/CXSourceLocation.cpp b/tools/libclang/CXSourceLocation.cpp
index 71383445c5..d8d4c96e48 100644
--- a/tools/libclang/CXSourceLocation.cpp
+++ b/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: