aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/api
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-11-20 16:00:03 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2017-11-23 10:31:32 +0000
commit846b4ece2a8dcb6b407edbf9d0b23095e15f4566 (patch)
tree8409603af9a27243d388729b8e3b3014a9481b28 /src/lib/corelib/api
parente9b79f0d5165dc71dac10ed76b5fa06508672605 (diff)
Share ScriptFunction objects between products
The source code of script functions does not differ among module instantiations, so there's no need to give each product its own copy. For example, resolving the QtCreator super project now allocates about 80 of these objects, rather than 16000, each of which had their own unshared copy of the script source code. Change-Id: I10d67991ce170826346d434fe58ea6608fa18a1f Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/lib/corelib/api')
-rw-r--r--src/lib/corelib/api/project.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/corelib/api/project.cpp b/src/lib/corelib/api/project.cpp
index 74fa42dec..2320b3623 100644
--- a/src/lib/corelib/api/project.cpp
+++ b/src/lib/corelib/api/project.cpp
@@ -661,7 +661,7 @@ void ProjectPrivate::updateInternalCodeLocations(const ResolvedProjectPtr &proje
for (const GroupPtr &group : qAsConst(product->groups))
updateLocationIfNecessary(group->location, changeLocation, lineOffset);
for (const RulePtr &rule : qAsConst(product->rules)) {
- updateLocationIfNecessary(rule->prepareScript->location, changeLocation, lineOffset);
+ updateLocationIfNecessary(rule->prepareScript.location(), changeLocation, lineOffset);
for (const RuleArtifactPtr &artifact : qAsConst(rule->artifacts)) {
for (auto &binding : artifact->bindings) {
updateLocationIfNecessary(binding.location, changeLocation, lineOffset);
@@ -669,13 +669,14 @@ void ProjectPrivate::updateInternalCodeLocations(const ResolvedProjectPtr &proje
}
}
for (const ResolvedScannerConstPtr &scanner : qAsConst(product->scanners)) {
- updateLocationIfNecessary(scanner->searchPathsScript->location, changeLocation, lineOffset);
- updateLocationIfNecessary(scanner->scanScript->location, changeLocation, lineOffset);
+ updateLocationIfNecessary(scanner->searchPathsScript.location(), changeLocation,
+ lineOffset);
+ updateLocationIfNecessary(scanner->scanScript.location(), changeLocation, lineOffset);
}
for (const ResolvedModuleConstPtr &module : qAsConst(product->modules)) {
- updateLocationIfNecessary(module->setupBuildEnvironmentScript->location,
+ updateLocationIfNecessary(module->setupBuildEnvironmentScript.location(),
changeLocation, lineOffset);
- updateLocationIfNecessary(module->setupRunEnvironmentScript->location,
+ updateLocationIfNecessary(module->setupRunEnvironmentScript.location(),
changeLocation, lineOffset);
}
}