[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
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 0e7193e..472c0b0 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -1548,6 +1548,7 @@
const char *check_prefix;
int first_check_printed;
int fail_for_error;
+ int abort;
} IndexData;
static void printCheck(IndexData *data) {
@@ -1850,8 +1851,14 @@
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 @@
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 @@
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"))