aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-28 04:56:00 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-28 04:56:00 +0000
commit6f3ce979a7748fd117e6473d6272b16d643b6262 (patch)
treede0942a2ca83386321511f21b544289d0862330f /tools/c-index-test/c-index-test.c
parent991bf49f68e8caeb900dd9738712b861073363d9 (diff)
[libclang] Indexing API: If the client requested to get a CXTranslationUnit after
indexing, honor all the TU options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145229 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test/c-index-test.c')
-rw-r--r--tools/c-index-test/c-index-test.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 0e7193ee10..472c0b0e95 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -1548,6 +1548,7 @@ typedef struct {
const char *check_prefix;
int first_check_printed;
int fail_for_error;
+ int abort;
} IndexData;
static void printCheck(IndexData *data) {
@@ -1850,8 +1851,14 @@ static void index_indexEntityReference(CXClientData client_data,
printf("\n");
}
+static int index_abortQuery(CXClientData client_data, void *reserved) {
+ IndexData *index_data;
+ index_data = (IndexData *)client_data;
+ return index_data->abort;
+}
+
static IndexerCallbacks IndexCB = {
- 0, /*abortQuery*/
+ index_abortQuery,
index_diagnostic,
index_enteredMainFile,
index_ppIncludedFile,
@@ -1894,6 +1901,7 @@ static int index_file(int argc, const char **argv) {
index_data.check_prefix = check_prefix;
index_data.first_check_printed = 0;
index_data.fail_for_error = 0;
+ index_data.abort = 0;
index_opts = 0;
if (getenv("CINDEXTEST_SUPPRESSREFS"))
@@ -1948,6 +1956,7 @@ static int index_tu(int argc, const char **argv) {
index_data.check_prefix = check_prefix;
index_data.first_check_printed = 0;
index_data.fail_for_error = 0;
+ index_data.abort = 0;
index_opts = 0;
if (getenv("CINDEXTEST_SUPPRESSREFS"))