summaryrefslogtreecommitdiff
path: root/src/tools/clangrefactoringbackend/source/clangtool.cpp
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2017-07-24 14:55:51 +0200
committerMarco Bubke <marco.bubke@qt.io>2017-08-29 16:37:09 +0000
commitf0e00a8c25ff123ad23dc295ecede5736a476685 (patch)
treea308c4cad8c2f39a5e5db9790ee1f495f94aa085 /src/tools/clangrefactoringbackend/source/clangtool.cpp
parent8640ef19278139ddee27b93eda1e57b9b51bddfa (diff)
downloadqt-creator-f0e00a8c25ff123ad23dc295ecede5736a476685.tar.gz
Clang: Add symbols collector
Change-Id: I64c25eef8eaa6cc6c3ff09d41866972b6c7248d0 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/tools/clangrefactoringbackend/source/clangtool.cpp')
-rw-r--r--src/tools/clangrefactoringbackend/source/clangtool.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tools/clangrefactoringbackend/source/clangtool.cpp b/src/tools/clangrefactoringbackend/source/clangtool.cpp
index a5ea8838fc..f52106f394 100644
--- a/src/tools/clangrefactoringbackend/source/clangtool.cpp
+++ b/src/tools/clangrefactoringbackend/source/clangtool.cpp
@@ -47,15 +47,15 @@ void ClangTool::addFile(std::string &&directory,
std::string &&content,
std::vector<std::string> &&commandLine)
{
- fileContents.emplace_back(toNativePath(std::move(directory)),
+ m_fileContents.emplace_back(toNativePath(std::move(directory)),
std::move(fileName),
std::move(content),
std::move(commandLine));
- const auto &fileContent = fileContents.back();
+ const auto &fileContent = m_fileContents.back();
- compilationDatabase.addFile(fileContent.directory, fileContent.fileName, fileContent.commandLine);
- sourceFilePaths.push_back(fileContent.filePath);
+ m_compilationDatabase.addFile(fileContent.directory, fileContent.fileName, fileContent.commandLine);
+ m_sourceFilePaths.push_back(fileContent.filePath);
}
template <typename Container>
@@ -86,7 +86,7 @@ void ClangTool::addFiles<Utils::PathStringVector>(const Utils::PathStringVector
void ClangTool::addUnsavedFiles(const V2::FileContainers &unsavedFiles)
{
- unsavedFileContents.reserve(unsavedFileContents.size() + unsavedFiles.size());
+ m_unsavedFileContents.reserve(m_unsavedFileContents.size() + unsavedFiles.size());
auto convertToUnsavedFileContent = [] (const V2::FileContainer &unsavedFile) {
return UnsavedFileContent{toNativePath(unsavedFile.filePath().path().clone()),
@@ -95,7 +95,7 @@ void ClangTool::addUnsavedFiles(const V2::FileContainers &unsavedFiles)
std::transform(unsavedFiles.begin(),
unsavedFiles.end(),
- std::back_inserter(unsavedFileContents),
+ std::back_inserter(m_unsavedFileContents),
convertToUnsavedFileContent);
}
@@ -109,14 +109,14 @@ llvm::StringRef toStringRef(const String &string)
clang::tooling::ClangTool ClangTool::createTool() const
{
- clang::tooling::ClangTool tool(compilationDatabase, sourceFilePaths);
+ clang::tooling::ClangTool tool(m_compilationDatabase, m_sourceFilePaths);
- for (const auto &fileContent : fileContents) {
+ for (const auto &fileContent : m_fileContents) {
if (!fileContent.content.empty())
tool.mapVirtualFile(fileContent.filePath, fileContent.content);
}
- for (const auto &unsavedFileContent : unsavedFileContents)
+ for (const auto &unsavedFileContent : m_unsavedFileContents)
tool.mapVirtualFile(toStringRef(unsavedFileContent.filePath),
toStringRef(unsavedFileContent.content));