aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/clangpchmanagerbackend/source/collectbuilddependencyaction.h
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2019-02-06 17:18:15 +0100
committerMarco Bubke <marco.bubke@qt.io>2019-02-11 15:23:26 +0000
commitffa043fb9983462ebeb143afb946c109e9369e7f (patch)
tree865c03ba0c37427b3d0acf45274b3b1659005f29 /src/tools/clangpchmanagerbackend/source/collectbuilddependencyaction.h
parent7fe65851d99465d8bd9506ba53d8772381666111 (diff)
Clang: Improve performance by reducing parsing
We generate one big file per project part so the preprocessor is skipping the recurring includes. This generated many errors about missing macros but we don't care much about them during dependency collection step so we just silence these errors with ignoring diagnostics consumer. Change-Id: I5581d623b5d5f9995496252735577ea6b54790d9 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/tools/clangpchmanagerbackend/source/collectbuilddependencyaction.h')
-rw-r--r--src/tools/clangpchmanagerbackend/source/collectbuilddependencyaction.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/tools/clangpchmanagerbackend/source/collectbuilddependencyaction.h b/src/tools/clangpchmanagerbackend/source/collectbuilddependencyaction.h
index 03d27f9b21..fa1a10e79c 100644
--- a/src/tools/clangpchmanagerbackend/source/collectbuilddependencyaction.h
+++ b/src/tools/clangpchmanagerbackend/source/collectbuilddependencyaction.h
@@ -54,27 +54,28 @@ public:
bool BeginSourceFileAction(clang::CompilerInstance &compilerInstance) override
{
- if (clang::PreprocessOnlyAction::BeginSourceFileAction(compilerInstance)) {
- auto &preprocessor = compilerInstance.getPreprocessor();
+ if (clang::PreprocessOnlyAction::BeginSourceFileAction(compilerInstance)) {
+ auto &preprocessor = compilerInstance.getPreprocessor();
- preprocessor.SetSuppressIncludeNotFoundError(true);
- preprocessor.SetMacroExpansionOnlyInDirectives();
+ preprocessor.SetSuppressIncludeNotFoundError(true);
+ preprocessor.SetMacroExpansionOnlyInDirectives();
- auto macroPreprocessorCallbacks = new CollectBuildDependencyPreprocessorCallbacks(
- m_buildDependency,
- m_filePathCache,
- m_excludedIncludeUID,
- m_alreadyIncludedFileUIDs,
- compilerInstance.getSourceManager(),
- m_sourcesManager,
- compilerInstance.getPreprocessorPtr());
+ auto macroPreprocessorCallbacks = new CollectBuildDependencyPreprocessorCallbacks(
+ m_buildDependency,
+ m_filePathCache,
+ m_excludedIncludeUID,
+ m_alreadyIncludedFileUIDs,
+ compilerInstance.getSourceManager(),
+ m_sourcesManager,
+ compilerInstance.getPreprocessorPtr());
- preprocessor.addPPCallbacks(std::unique_ptr<clang::PPCallbacks>(macroPreprocessorCallbacks));
+ preprocessor.addPPCallbacks(
+ std::unique_ptr<clang::PPCallbacks>(macroPreprocessorCallbacks));
- return true;
- }
+ return true;
+ }
- return false;
+ return false;
}
void EndSourceFileAction() override