aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2019-07-10 15:58:23 +0200
committerMarco Bubke <marco.bubke@qt.io>2019-07-11 09:03:01 +0000
commit1841cb1fa5abe2fa33fdb25838aef8b81f0b852f (patch)
treebdcc709f4e060a62d9fb9239a4d817fa52dabe17 /src/tools
parent56277de27f0753e52482a302d9a43b230268f59d (diff)
ClangPchManager: Fix path for excluded include files
Still used the old approach but now it is using the new one. Change-Id: I4bf4da3a5d41d46afff261f3d77bd9190737038a Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/clangpchmanagerbackend/source/builddependencycollector.cpp14
-rw-r--r--src/tools/clangpchmanagerbackend/source/collectbuilddependencytoolaction.h6
-rw-r--r--src/tools/clangrefactoringbackend/source/clangtool.cpp2
-rw-r--r--src/tools/clangrefactoringbackend/source/clangtool.h4
4 files changed, 8 insertions, 18 deletions
diff --git a/src/tools/clangpchmanagerbackend/source/builddependencycollector.cpp b/src/tools/clangpchmanagerbackend/source/builddependencycollector.cpp
index b2c6cf8f86..20f08e257e 100644
--- a/src/tools/clangpchmanagerbackend/source/builddependencycollector.cpp
+++ b/src/tools/clangpchmanagerbackend/source/builddependencycollector.cpp
@@ -136,19 +136,7 @@ void BuildDependencyCollector::collect()
void BuildDependencyCollector::setExcludedFilePaths(ClangBackEnd::FilePaths &&excludedFilePaths)
{
- if (Utils::HostOsInfo::isWindowsHost()) {
- m_excludedFilePaths.clear();
- m_excludedFilePaths.reserve(excludedFilePaths.size());
- std::transform(std::make_move_iterator(excludedFilePaths.begin()),
- std::make_move_iterator(excludedFilePaths.end()),
- std::back_inserter(m_excludedFilePaths),
- [](auto &&path) {
- path.replace("/", "\\");
- return std::move(path);
- });
- } else {
- m_excludedFilePaths = std::move(excludedFilePaths);
- }
+ m_excludedFilePaths = std::move(excludedFilePaths);
}
void BuildDependencyCollector::addFiles(const FilePathIds &filePathIds,
diff --git a/src/tools/clangpchmanagerbackend/source/collectbuilddependencytoolaction.h b/src/tools/clangpchmanagerbackend/source/collectbuilddependencytoolaction.h
index 471291ee90..538f2c7d3f 100644
--- a/src/tools/clangpchmanagerbackend/source/collectbuilddependencytoolaction.h
+++ b/src/tools/clangpchmanagerbackend/source/collectbuilddependencytoolaction.h
@@ -73,8 +73,10 @@ public:
std::vector<uint> fileUIDs;
fileUIDs.reserve(m_excludedFilePaths.size());
- for (const ClangBackEnd::FilePath &filePath : m_excludedFilePaths) {
- const clang::FileEntry *file = fileManager.getFile({filePath.data(), filePath.size()},
+ for (const FilePath &filePath : m_excludedFilePaths) {
+ NativeFilePath nativeFilePath{filePath};
+ const clang::FileEntry *file = fileManager.getFile({nativeFilePath.path().data(),
+ nativeFilePath.path().size()},
true);
if (file)
diff --git a/src/tools/clangrefactoringbackend/source/clangtool.cpp b/src/tools/clangrefactoringbackend/source/clangtool.cpp
index b96f479a81..34c6b02c64 100644
--- a/src/tools/clangrefactoringbackend/source/clangtool.cpp
+++ b/src/tools/clangrefactoringbackend/source/clangtool.cpp
@@ -57,7 +57,7 @@ void ClangTool::addUnsavedFiles(const V2::FileContainers &unsavedFiles)
m_unsavedFileContents.reserve(m_unsavedFileContents.size() + unsavedFiles.size());
auto convertToUnsavedFileContent = [](const V2::FileContainer &unsavedFile) {
- return UnsavedFileContent{unsavedFile.filePath.clone(),
+ return UnsavedFileContent{NativeFilePath{unsavedFile.filePath},
unsavedFile.unsavedFileContent.clone()};
};
diff --git a/src/tools/clangrefactoringbackend/source/clangtool.h b/src/tools/clangrefactoringbackend/source/clangtool.h
index 1f266e86eb..2abad0f49b 100644
--- a/src/tools/clangrefactoringbackend/source/clangtool.h
+++ b/src/tools/clangrefactoringbackend/source/clangtool.h
@@ -55,12 +55,12 @@ struct FileContent
struct UnsavedFileContent
{
- UnsavedFileContent(FilePath &&filePath, Utils::SmallString &&content)
+ UnsavedFileContent(NativeFilePath &&filePath, Utils::SmallString &&content)
: filePath(std::move(filePath))
, content(std::move(content))
{}
- FilePath filePath;
+ NativeFilePath filePath;
Utils::SmallString content;
};