diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-12-15 09:30:31 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-12-15 09:30:31 +0000 |
| commit | 5c248d89f316fab5569dc79c54b50bd4de7f04a6 (patch) | |
| tree | d96f3054502dab2b1f5d91bb463acb6746f99c1c /clang/test | |
| parent | 6045cc89bd81fa8915ad809e982902bcfc741632 (diff) | |
| download | bcm5719-llvm-5c248d89f316fab5569dc79c54b50bd4de7f04a6.tar.gz bcm5719-llvm-5c248d89f316fab5569dc79c54b50bd4de7f04a6.zip | |
[libclang] Add a flag to create the precompiled preamble on the first parse.
Summary:
The current default is to create the preamble on the first reparse, aka
second parse. This is useful for clients that do not want to block when
opening a file because serializing the preamble takes a bit of time.
However, this makes the reparse much more expensive and that may be on the
critical path as it's the first interaction a user has with the source code.
YouCompleteMe currently optimizes for the first code interaction by parsing
the file twice when loaded. That's just unnecessarily slow and this flag
helps to avoid that.
Reviewers: doug.gregor, klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D15490
llvm-svn: 255635
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Index/complete-preamble.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/test/Index/complete-preamble.cpp b/clang/test/Index/complete-preamble.cpp index c57c88ab330..15720f9a297 100644 --- a/clang/test/Index/complete-preamble.cpp +++ b/clang/test/Index/complete-preamble.cpp @@ -3,6 +3,15 @@ void f() { std:: } -// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:3:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s -// CHECK-CC1: {ResultType void}{TypedText wibble}{LeftParen (}{RightParen )} (50) +// RUN: env CINDEXTEST_EDITING=1 LIBCLANG_TIMING=1 c-index-test -code-completion-at=%s:3:8 %s -o - 2>&1 | FileCheck -check-prefix=CHECK-CC1 -check-prefix=SECOND %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_CREATE_PREAMBLE_ON_FIRST_PARSE=1 LIBCLANG_TIMING=1 c-index-test -code-completion-at=%s:3:8 %s -o - 2>&1 | FileCheck -check-prefix=CHECK-CC1 -check-prefix=FIRST %s + +// FIRST: Precompiling preamble +// FIRST: Parsing +// FIRST: Reparsing +// SECOND: Parsing +// SECOND: Precompiling preamble +// SECOND: Reparsing + +// CHECK-CC1: {ResultType void}{TypedText wibble}{LeftParen (}{RightParen )} (50) |

