forked from qt-creator/qt-creator
Clang: Prepare for multi-threading
* Make the necessary data implicitly shared since it might get accessed/modified from two different threads with follow-up changes. This applies for UnsavedFiles/UnsavedFile and ProjectPart::arguments(). * Avoid returning references. Change-Id: I98842c1cb90ae0d344a15c63b72cbc89568722d3 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
namespace ClangBackEnd {
|
||||
|
||||
CommandLineArguments::CommandLineArguments(const char *filePath,
|
||||
const std::vector<const char *> &projectPartArguments,
|
||||
const Utf8StringVector &projectPartArguments,
|
||||
const Utf8StringVector &fileArguments,
|
||||
bool addVerboseOption)
|
||||
{
|
||||
@@ -46,7 +46,8 @@ CommandLineArguments::CommandLineArguments(const char *filePath,
|
||||
+ (addVerboseOption ? 1 : 0);
|
||||
m_arguments.reserve(elementsToReserve);
|
||||
|
||||
m_arguments = projectPartArguments;
|
||||
for (const auto &argument : projectPartArguments)
|
||||
m_arguments.push_back(argument.constData());
|
||||
for (const auto &argument : fileArguments)
|
||||
m_arguments.push_back(argument.constData());
|
||||
if (addVerboseOption)
|
||||
|
||||
Reference in New Issue
Block a user