summaryrefslogtreecommitdiffstats
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-11-04 15:04:32 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-11-04 15:04:32 +0000
commitb6d5e15aae202f157c6cd63da8fa4b089e7b31e9 (patch)
tree59e0e47a9831dcf0e21e547927c8ebb7e113bfd1 /tools/c-index-test/c-index-test.c
parent5563df30b9c8d1fe87a54baae0d6bd86642563f4 (diff)
downloadFreeBSD-src-b6d5e15aae202f157c6cd63da8fa4b089e7b31e9.zip
FreeBSD-src-b6d5e15aae202f157c6cd63da8fa4b089e7b31e9.tar.gz
Update clang to r86025.
Diffstat (limited to 'tools/c-index-test/c-index-test.c')
-rw-r--r--tools/c-index-test/c-index-test.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index cf2a706..8791ee2 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -4,7 +4,23 @@
#include <stdio.h>
#include <string.h>
+#ifdef _MSC_VER
+char *basename(const char* path)
+{
+ char* base1 = (char*)strrchr(path, '/');
+ char* base2 = (char*)strrchr(path, '\\');
+ if (base1 && base2)
+ return((base1 > base2) ? base1 + 1 : base2 + 1);
+ else if (base1)
+ return(base1 + 1);
+ else if (base2)
+ return(base2 + 1);
+
+ return((char*)path);
+}
+#else
extern char *basename(const char *);
+#endif
static void PrintCursor(CXCursor Cursor) {
if (clang_isInvalid(Cursor.kind))
@@ -54,7 +70,6 @@ static void TranslationUnitVisitor(CXTranslationUnit Unit, CXCursor Cursor,
CXCursor Ref;
while (startBuf < endBuf) {
- CXLookupHint hint;
if (*startBuf == '\n') {
startBuf++;
curLine++;
@@ -62,11 +77,8 @@ static void TranslationUnitVisitor(CXTranslationUnit Unit, CXCursor Cursor,
} else if (*startBuf != '\t')
curColumn++;
- clang_initCXLookupHint(&hint);
- hint.decl = Cursor.decl;
-
- Ref = clang_getCursorWithHint(Unit, clang_getCursorSource(Cursor),
- curLine, curColumn, &hint);
+ Ref = clang_getCursor(Unit, clang_getCursorSource(Cursor),
+ curLine, curColumn);
if (Ref.kind == CXCursor_NoDeclFound) {
/* Nothing found here; that's fine. */
} else if (Ref.kind != CXCursor_FunctionDecl) {
OpenPOWER on IntegriCloud