summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/sharedvisitor/analyzer.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-09-03 16:17:14 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-09-06 12:07:23 +0200
commitdc79dc76f18148296ae18ed7251cf61505e25d44 (patch)
tree65edee50f0c257c578f8459dbfcdc9db61c52e5a /compilerplugins/clang/sharedvisitor/analyzer.cxx
parentceb26770b3d1c5c2ffaf73f8f589c5e169e6db06 (diff)
make clangplugin analyzer use internally a PCH to speed things up
This generally makes the sharedvisitor performance reasonable. The only costly thing that remains is compiling the large sharedvisitor.cxx, which with optimizations takes quite some time, but there's ccache for that. Change-Id: Iffa5fc9df34cdb5edf1cde34fc558fd007ef8263 Reviewed-on: https://gerrit.libreoffice.org/78569 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'compilerplugins/clang/sharedvisitor/analyzer.cxx')
-rw-r--r--compilerplugins/clang/sharedvisitor/analyzer.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/compilerplugins/clang/sharedvisitor/analyzer.cxx b/compilerplugins/clang/sharedvisitor/analyzer.cxx
index 171fc8528a28..5b716f407fd4 100644
--- a/compilerplugins/clang/sharedvisitor/analyzer.cxx
+++ b/compilerplugins/clang/sharedvisitor/analyzer.cxx
@@ -243,14 +243,19 @@ int main(int argc, char** argv)
#define STRINGIFY(a) STRINGIFY2(a)
args.insert(
args.end(),
- {
+ { // These must match LO_CLANG_ANALYZER_PCH_CXXFLAGS in Makefile-clang.mk .
"-I" BUILDDIR "/config_host", // plugin sources use e.g. config_global.h
"-I" STRINGIFY(CLANGDIR) "/include", // clang's headers
"-I" STRINGIFY(CLANGSYSINCLUDE), // clang system headers
STDOPTION,
"-D__STDC_CONSTANT_MACROS", // Clang headers require these.
"-D__STDC_FORMAT_MACROS",
- "-D__STDC_LIMIT_MACROS",
+ "-D__STDC_LIMIT_MACROS"
+#ifdef LO_CLANG_USE_ANALYZER_PCH
+ ,
+ "-include-pch", // use PCH with Clang headers to speed up parsing/analysing
+ BUILDDIR "/compilerplugins/clang/sharedvisitor/clang.pch"
+#endif
});
for( ; i < argc; ++ i )
{