aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-10-24 11:41:18 -0700
committerJake Petroules <jake.petroules@qt.io>2017-11-22 16:15:21 +0000
commit1445ea6d69146b2c05efbfe142c557f9bf724025 (patch)
treebf18018fbd4254f1aeb624ab61a9862e4aa8a951 /src/lib/corelib/buildgraph
parentc8d0d4fe646e60daea678602d7ca71e492fb65ad (diff)
STL compatibility: use push_back() instead of append()
...or operator<< if the argument was itself a list, or brace init where appropriate. This is a simple find and replace with manual sanity check. Change-Id: I94b79cbf3752192dd258001bf1dfcd46f58ca352 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph')
-rw-r--r--src/lib/corelib/buildgraph/buildgraph.cpp2
-rw-r--r--src/lib/corelib/buildgraph/depscanner.cpp8
-rw-r--r--src/lib/corelib/buildgraph/environmentscriptrunner.cpp10
-rw-r--r--src/lib/corelib/buildgraph/executor.cpp6
-rw-r--r--src/lib/corelib/buildgraph/inputartifactscanner.cpp6
-rw-r--r--src/lib/corelib/buildgraph/projectbuilddata.cpp4
-rw-r--r--src/lib/corelib/buildgraph/rulegraph.cpp4
-rw-r--r--src/lib/corelib/buildgraph/transformer.cpp2
8 files changed, 21 insertions, 21 deletions
diff --git a/src/lib/corelib/buildgraph/buildgraph.cpp b/src/lib/corelib/buildgraph/buildgraph.cpp
index 0baacc27d..00b025698 100644
--- a/src/lib/corelib/buildgraph/buildgraph.cpp
+++ b/src/lib/corelib/buildgraph/buildgraph.cpp
@@ -353,7 +353,7 @@ void setupScriptEngineForProduct(ScriptEngine *engine, ResolvedProduct *product,
bool findPath(BuildGraphNode *u, BuildGraphNode *v, QList<BuildGraphNode *> &path)
{
if (u == v) {
- path.append(v);
+ path.push_back(v);
return true;
}
diff --git a/src/lib/corelib/buildgraph/depscanner.cpp b/src/lib/corelib/buildgraph/depscanner.cpp
index e0fae57c9..8b5a0a0fe 100644
--- a/src/lib/corelib/buildgraph/depscanner.cpp
+++ b/src/lib/corelib/buildgraph/depscanner.cpp
@@ -232,9 +232,9 @@ QStringList UserDependencyScanner::evaluate(Artifact *artifact, const ScriptFunc
QScriptValueList args;
args.reserve(3);
- args.append(m_global.property(QString::fromLatin1("project")));
- args.append(m_global.property(QString::fromLatin1("product")));
- args.append(Transformer::translateFileConfig(m_engine, artifact, m_scanner->module->name));
+ args.push_back(m_global.property(QString::fromLatin1("project")));
+ args.push_back(m_global.property(QString::fromLatin1("product")));
+ args.push_back(Transformer::translateFileConfig(m_engine, artifact, m_scanner->module->name));
m_engine->setGlobalObject(m_global);
QScriptValue &function = script->scriptFunction;
@@ -259,7 +259,7 @@ QStringList UserDependencyScanner::evaluate(Artifact *artifact, const ScriptFunc
for (qint32 i = 0; i < count; ++i) {
QScriptValue item = result.property(i);
if (item.isValid() && !item.isUndefined())
- list.append(item.toString());
+ list.push_back(item.toString());
}
}
return list;
diff --git a/src/lib/corelib/buildgraph/environmentscriptrunner.cpp b/src/lib/corelib/buildgraph/environmentscriptrunner.cpp
index 34c80fd0a..6a143c16f 100644
--- a/src/lib/corelib/buildgraph/environmentscriptrunner.cpp
+++ b/src/lib/corelib/buildgraph/environmentscriptrunner.cpp
@@ -90,9 +90,9 @@ static QList<const ResolvedModule*> topSortModules(const QHash<const ResolvedMod
for (const ResolvedModule * const m : modules) {
if (m->name.isNull())
continue;
- result.append(topSortModules(moduleChildren, moduleChildren.value(m), seenModuleNames));
+ result << topSortModules(moduleChildren, moduleChildren.value(m), seenModuleNames);
if (seenModuleNames.insert(m->name).second)
- result.append(m);
+ result.push_back(m);
}
return result;
}
@@ -141,8 +141,8 @@ void EnvironmentScriptRunner::setupEnvironment()
for (const QString &moduleName : qAsConst(module->moduleDependencies)) {
const ResolvedModule * const depmod = moduleMap.value(moduleName);
QBS_ASSERT(depmod, return);
- moduleParents[depmod].append(module.get());
- moduleChildren[module.get()].append(depmod);
+ moduleParents[depmod].push_back(module.get());
+ moduleChildren[module.get()].push_back(depmod);
}
}
@@ -150,7 +150,7 @@ void EnvironmentScriptRunner::setupEnvironment()
for (const ResolvedModuleConstPtr &module : m_product->modules) {
if (moduleParents.value(module.get()).isEmpty()) {
QBS_ASSERT(module, return);
- rootModules.append(module.get());
+ rootModules.push_back(module.get());
}
}
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp
index 6d5cc9f90..819ed7d99 100644
--- a/src/lib/corelib/buildgraph/executor.cpp
+++ b/src/lib/corelib/buildgraph/executor.cpp
@@ -531,7 +531,7 @@ void Executor::finishJob(ExecutorJob *job, bool success)
QBS_CHECK(it != m_processingJobs.end());
const TransformerPtr transformer = it.value();
m_processingJobs.erase(it);
- m_availableJobs.append(job);
+ m_availableJobs.push_back(job);
if (success) {
m_project->buildData->isDirty = true;
for (Artifact * const artifact : qAsConst(transformer->outputs)) {
@@ -710,7 +710,7 @@ void Executor::addExecutorJobs()
job->setObjectName(QString::fromLatin1("J%1").arg(i));
job->setDryRun(m_buildOptions.dryRun());
job->setEchoMode(m_buildOptions.echoMode());
- m_availableJobs.append(job);
+ m_availableJobs.push_back(job);
connect(job, &ExecutorJob::reportCommandDescription,
this, &Executor::reportCommandDescription);
connect(job, &ExecutorJob::reportProcessResult, this, &Executor::reportProcessResult);
@@ -1122,7 +1122,7 @@ void Executor::prepareArtifact(Artifact *artifact)
const FileTime oldTimestamp = artifact->timestamp();
retrieveSourceFileTimestamp(artifact);
if (oldTimestamp != artifact->timestamp())
- m_changedSourceArtifacts.append(artifact);
+ m_changedSourceArtifacts.push_back(artifact);
possiblyInstallArtifact(artifact);
}
diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.cpp b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
index 31e54486e..13314eb52 100644
--- a/src/lib/corelib/buildgraph/inputartifactscanner.cpp
+++ b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
@@ -149,7 +149,7 @@ void InputArtifactScanner::scanForFileDependencies(Artifact *inputArtifact)
InputArtifactScannerContext::CacheItem &cacheItem = m_context->cache[inputArtifact->properties];
Set<QString> visitedFilePaths;
QList<FileResourceBase *> filesToScan;
- filesToScan.append(inputArtifact);
+ filesToScan.push_back(inputArtifact);
const Set<DependencyScanner *> scanners = scannersForArtifact(inputArtifact);
if (scanners.empty())
return;
@@ -270,11 +270,11 @@ resolved:
// Do not scan an artifact that is not built yet: Its contents might still change.
if (artifactDependency->artifactType == Artifact::SourceFile
|| artifactDependency->buildState == BuildGraphNode::Built) {
- artifactsToScan->append(artifactDependency);
+ artifactsToScan->push_back(artifactDependency);
}
} else {
// Add file dependency to the next round of scanning.
- artifactsToScan->append(resolvedDependency.file);
+ artifactsToScan->push_back(resolvedDependency.file);
}
}
}
diff --git a/src/lib/corelib/buildgraph/projectbuilddata.cpp b/src/lib/corelib/buildgraph/projectbuilddata.cpp
index 258943051..7b7e30cc3 100644
--- a/src/lib/corelib/buildgraph/projectbuilddata.cpp
+++ b/src/lib/corelib/buildgraph/projectbuilddata.cpp
@@ -118,7 +118,7 @@ void ProjectBuildData::insertIntoLookupTable(FileResourceBase *fileres)
}
}
QBS_CHECK(!lst.contains(fileres));
- lst.append(fileres);
+ lst.push_back(fileres);
}
void ProjectBuildData::removeFromLookupTable(FileResourceBase *fileres)
@@ -344,7 +344,7 @@ private:
}
throw ErrorInfo(Tr::tr("Cycle detected in rule dependencies: %1").arg(pathstr));
}
- m_rulePath.append(rule.get());
+ m_rulePath.push_back(rule.get());
RuleNode *node = m_nodePerRule.value(rule);
if (!node) {
node = new RuleNode;
diff --git a/src/lib/corelib/buildgraph/rulegraph.cpp b/src/lib/corelib/buildgraph/rulegraph.cpp
index e782b3f32..24749767e 100644
--- a/src/lib/corelib/buildgraph/rulegraph.cpp
+++ b/src/lib/corelib/buildgraph/rulegraph.cpp
@@ -56,7 +56,7 @@ void RuleGraph::build(const QList<RulePtr> &rules, const FileTags &productFileTa
m_rules.reserve(rules.size());
for (const RulePtr &rule : rules) {
for (const FileTag &fileTag : rule->collectedOutputFileTags())
- m_outputFileTagToRule[fileTag].append(rule.get());
+ m_outputFileTagToRule[fileTag].push_back(rule.get());
insert(rule);
}
@@ -68,7 +68,7 @@ void RuleGraph::build(const QList<RulePtr> &rules, const FileTags &productFileTa
inFileTags += rule->auxiliaryInputs;
inFileTags += rule->explicitlyDependsOn;
for (const FileTag &fileTag : qAsConst(inFileTags)) {
- inputFileTagToRule[fileTag].append(rule.get());
+ inputFileTagToRule[fileTag].push_back(rule.get());
for (const Rule * const producingRule : m_outputFileTagToRule.value(fileTag)) {
if (!producingRule->collectedOutputFileTags().intersects(
rule->excludedAuxiliaryInputs)) {
diff --git a/src/lib/corelib/buildgraph/transformer.cpp b/src/lib/corelib/buildgraph/transformer.cpp
index 4e2bfd350..1e474e1e2 100644
--- a/src/lib/corelib/buildgraph/transformer.cpp
+++ b/src/lib/corelib/buildgraph/transformer.cpp
@@ -136,7 +136,7 @@ QScriptValue Transformer::translateInOutputs(ScriptEngine *scriptEngine,
TagArtifactsMap tagArtifactsMap;
for (Artifact *artifact : artifacts)
for (const FileTag &fileTag : artifact->fileTags())
- tagArtifactsMap[fileTag.toString()].append(artifact);
+ tagArtifactsMap[fileTag.toString()].push_back(artifact);
for (TagArtifactsMap::Iterator it = tagArtifactsMap.begin(); it != tagArtifactsMap.end(); ++it)
std::sort(it.value().begin(), it.value().end(), compareByFilePath);