aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-15 23:00:34 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-15 23:00:34 +0000
commit08bb4c622d0b79c33b4ac78ce1bec79398953daa (patch)
treeb26e3d6f3b1887043d26ed7a0c40af50a308478e /tools/c-index-test/c-index-test.c
parente4ae4dc87fa57e3062077514964b6d75bfa1fed1 (diff)
Tweak libclang's heuristics for building precompiled preambles and
caching global code-completion results. In particular, don't perform either operation the first time we parse, but do both after the first reparse. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119285 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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index ae36a8e996..edaf116d9a 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -1040,6 +1040,11 @@ int perform_code_completion(int argc, const char **argv, int timing_only) {
fprintf(stderr, "Unable to load translation unit!\n");
return 1;
}
+
+ if (clang_reparseTranslationUnit(TU, 0, 0, clang_defaultReparseOptions(TU))) {
+ fprintf(stderr, "Unable to reparse translation init!\n");
+ return 1;
+ }
for (I = 0; I != Repeats; ++I) {
results = clang_codeCompleteAt(TU, filename, line, column,