summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r--clang/tools/c-index-test/c-index-test.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index 34332d3e408..391f577bc43 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -59,6 +59,9 @@ static void PrintCursor(CXCursor Cursor) {
CXSourceLocation Loc = clang_getCursorLocation(Referenced);
printf(":%d:%d", Loc.line, Loc.column);
}
+
+ if (clang_isCursorDefinition(Cursor))
+ printf(" (Definition)");
}
}
@@ -125,7 +128,8 @@ static void FunctionScanVisitor(CXTranslationUnit Unit, CXCursor Cursor,
unsigned startLine, startColumn, endLine, endColumn, curLine, curColumn;
CXCursor Ref;
- if (Cursor.kind != CXCursor_FunctionDefn)
+ if (Cursor.kind != CXCursor_FunctionDecl ||
+ !clang_isCursorDefinition(Cursor))
return;
clang_getDefinitionSpellingAndExtent(Cursor, &startBuf, &endBuf,
OpenPOWER on IntegriCloud