diff options
author | Alex Lorenz <arphaman@gmail.com> | 2019-09-11 20:40:31 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2019-09-11 20:40:31 +0000 |
commit | 2f84230495c48ff3c1374151ce35a6c0a54ad01e (patch) | |
tree | be335ae9f499dbbe2db0326747589630ee7c70de /test | |
parent | f5d449a52774ee2e43614ab6cffd5408247a598b (diff) | |
download | clang-2f84230495c48ff3c1374151ce35a6c0a54ad01e.tar.gz |
[clang-scan-deps] add skip excluded conditional preprocessor block preprocessing optimization
This commit adds an optimization to clang-scan-deps and clang's preprocessor that skips excluded preprocessor
blocks by bumping the lexer pointer, and not lexing the tokens until reaching appropriate #else/#endif directive.
The skip positions and lexer offsets are computed when the file is minimized, directly from the minimized tokens.
On an 18-core iMacPro with macOS Catalina Beta I got 10-15% speed-up from this optimization when running clang-scan-deps on
the compilation database for a recent LLVM and Clang (3511 files).
Differential Revision: https://reviews.llvm.org/D67127
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/ClangScanDeps/regular_cdb.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ClangScanDeps/regular_cdb.cpp b/test/ClangScanDeps/regular_cdb.cpp index 9d367a402f..3060878154 100644 --- a/test/ClangScanDeps/regular_cdb.cpp +++ b/test/ClangScanDeps/regular_cdb.cpp @@ -12,6 +12,8 @@ // RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s // RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess | \ // RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s +// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-minimized-sources \ +// RUN: -skip-excluded-pp-ranges=0 | FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s // // Make sure we didn't produce any dependency files! // RUN: not cat %t.dir/regular_cdb.d |