summaryrefslogtreecommitdiff
path: root/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2019-04-24 14:07:39 +0200
committerMarco Bubke <marco.bubke@qt.io>2019-04-29 12:52:05 +0000
commit2d520140d01a8c6d9ff88c7f7205dfa28cc06d2d (patch)
tree04113edcfbf43f62552acfe226b5a6bd307f5ded /src/tools/clangrefactoringbackend/source/symbolindexer.cpp
parent1975641a3d0ccb3f36452524a57f7d2303b62b25 (diff)
downloadqt-creator-2d520140d01a8c6d9ff88c7f7205dfa28cc06d2d.tar.gz
Clang: Fix system pre include search path
We now get the resource path from creator. The -fPIC case is working now too. Change-Id: Id191e89e6d46706748d50440038a06a349972cc9 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/tools/clangrefactoringbackend/source/symbolindexer.cpp')
-rw-r--r--src/tools/clangrefactoringbackend/source/symbolindexer.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/tools/clangrefactoringbackend/source/symbolindexer.cpp b/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
index 109e6c5e80..dd1069736f 100644
--- a/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
+++ b/src/tools/clangrefactoringbackend/source/symbolindexer.cpp
@@ -29,6 +29,7 @@
#include "symbolindexertaskqueue.h"
#include <commandlinebuilder.h>
+#include <environment.h>
#include <chrono>
#include <iostream>
@@ -67,7 +68,8 @@ SymbolIndexer::SymbolIndexer(SymbolIndexerTaskQueueInterface &symbolIndexerTaskQ
FileStatusCache &fileStatusCache,
Sqlite::TransactionInterface &transactionInterface,
ProjectPartsStorageInterface &projectPartsStorage,
- ModifiedTimeCheckerInterface<SourceTimeStamps> &modifiedTimeChecker)
+ ModifiedTimeCheckerInterface<SourceTimeStamps> &modifiedTimeChecker,
+ const Environment &environment)
: m_symbolIndexerTaskQueue(symbolIndexerTaskQueue)
, m_symbolStorage(symbolStorage)
, m_buildDependencyStorage(buildDependenciesStorage)
@@ -78,6 +80,7 @@ SymbolIndexer::SymbolIndexer(SymbolIndexerTaskQueueInterface &symbolIndexerTaskQ
, m_transactionInterface(transactionInterface)
, m_projectPartsStorage(projectPartsStorage)
, m_modifiedTimeChecker(modifiedTimeChecker)
+ , m_environment(environment)
{
pathWatcher.setNotifier(this);
}
@@ -99,8 +102,10 @@ void SymbolIndexer::updateProjectPart(ProjectPartContainer &&projectPart)
sourcePathId);
if (!m_modifiedTimeChecker.isUpToDate(dependentTimeStamps)) {
- auto indexing = [projectPart = std::move(projectPart), sourcePathId, this](
- SymbolsCollectorInterface &symbolsCollector) {
+ auto indexing = [projectPart = std::move(projectPart),
+ sourcePathId,
+ preIncludeSearchPath = m_environment.preIncludeSearchPath(),
+ this](SymbolsCollectorInterface &symbolsCollector) {
auto collect = [&](const FilePath &pchPath) {
using Builder = CommandLineBuilder<ProjectPartContainer, Utils::SmallStringVector>;
Builder commandLineBuilder{projectPart,
@@ -108,7 +113,8 @@ void SymbolIndexer::updateProjectPart(ProjectPartContainer &&projectPart)
InputFileType::Source,
{},
{},
- pchPath};
+ pchPath,
+ preIncludeSearchPath};
symbolsCollector.setFile(sourcePathId, commandLineBuilder.commandLine);
return symbolsCollector.collectSymbols();
@@ -174,13 +180,21 @@ void SymbolIndexer::updateChangedPath(FilePathId filePathId,
SourceTimeStamps dependentTimeStamps = m_symbolStorage.fetchIncludedIndexingTimeStamps(filePathId);
- auto indexing = [optionalArtefact = std::move(optionalArtefact), filePathId, this](
- SymbolsCollectorInterface &symbolsCollector) {
+ auto indexing = [optionalArtefact = std::move(optionalArtefact),
+ filePathId,
+ preIncludeSearchPath = m_environment.preIncludeSearchPath(),
+ this](SymbolsCollectorInterface &symbolsCollector) {
auto collect = [&](const FilePath &pchPath) {
const ProjectPartArtefact &artefact = *optionalArtefact;
using Builder = CommandLineBuilder<ProjectPartArtefact, Utils::SmallStringVector>;
- Builder builder{artefact, artefact.toolChainArguments, InputFileType::Source, {}, {}, pchPath};
+ Builder builder{artefact,
+ artefact.toolChainArguments,
+ InputFileType::Source,
+ {},
+ {},
+ pchPath,
+ preIncludeSearchPath};
symbolsCollector.setFile(filePathId, builder.commandLine);