aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/projectbuilddata.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use std:: containers in ProjectBuildDataIvan Komissarov2019-05-221-8/+9
| | | | | | | | | | | | | | | It appears, that destruction of complex QHashes/QLists took a bit time in refcounts. Optimize them by using std::unordered_map and std::vector instead. Plus, make structure simplier, instead of 2 hashes, use pair as a key. qbs::Internal::ProjectBuildData::~ProjectBuildData() Before: 11.00 ms 0.1% After: 6.00 ms 0.0% Change-Id: I82d8bec5a465210cfa54762088f47c606c0e48e5 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use pass-by-value and moveIvan Komissarov2019-03-071-1/+1
| | | | | | | This fixes -Wmodernize-pass-by-value Change-Id: I85a732867866e43c39c1d77937fbc645433c96bd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add const-references for non trivial types in range-for loopsIvan Komissarov2019-02-201-2/+2
| | | | | | | This fixes -Wclazy-range-loop Change-Id: I5424d2626d6134ac7be2ce70b83f5a617f58dd7e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* corelib: Apply modernize-use-autoAlessandro Portale2018-08-201-1/+1
| | | | | | | Use more auto. Change-Id: I27e1e2345c6bede459a375663be72ec3370a5e39 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Speed up the removeFromRuleNodes() functionChristian Kandeler2018-07-181-8/+2
| | | | | | | | It is quite silly to traverse all rule nodes in the entire project when we have the relevant ones available as the artifact's parents. Change-Id: Ic5420011375bbc8c8af099093e702df9a5a863ca Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix excessive logging outputChristian Kandeler2018-07-121-6/+2
| | | | | | | | | | | ... when removing an artifact from the "old inputs" list of rule nodes. We would print this message for every rule in the project, regardless of whether it had anything to do with the artifact. Instead, only print it for rule nodes that actually had the artifact in the list. Change-Id: Iad4a099769639a68ae82218be190b25a46814ae1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge 1.12 into masterChristian Kandeler2018-07-061-2/+2
|\ | | | | | | Change-Id: I616949b321c26699ada0f2ae81b20a88db40b610
| * Remove quotes and escaping from debug logsOrgad Shaneh2018-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | Before: qbs.exec: adding leaf "RULE [c_pch][c_pch_src] [test] located at F:\\Projects\\qt-creator\\build-qtc\\share\\qtcreator\\qbs\\share\\qbs\\modules\\cpp\\GenericGCC.qbs:616:18" After: qbs.exec: adding leaf RULE [c_pch][c_pch_src] [test] located at F:\Projects\qt-creator\build-qtc\share\qtcreator\qbs\share\qbs\modules\cpp\GenericGCC.qbs:616:18 Change-Id: Ia1bcc197b9ce71934febbde7515b5d71d3cde0db Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Get rid of the code marking a rule for re-applicationChristian Kandeler2018-06-251-5/+1
|/ | | | | | | | I do not see what functionality this code adds to the change tracking procedure. Change-Id: Id3809564b8cb3517b5932b18aeaad3ba5588905a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Consider Transformer::explicitlyDependsOn when disconnecting artifactsChristian Kandeler2018-06-201-0/+1
| | | | | | | | | This was forgotten in d0e8197bbf. As a result, transformers could hold references to invalid artifacts, resulting in a crash when storing the build graph. Change-Id: I6af0d15d0c0ad44f1f9011c88e413f327a05943d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add new property explicitlyDependsOnFromDependenciesAlexandru Croitor2018-05-091-2/+3
| | | | | | | | | | | | | | | | This change adds new Rule item property called explicitlyDependsOnFromDependencies. It allows specifying a list of file tags to consider in dependent target artifacts which should be used as dependencies. [ChangeLog] The Rule item property explicitlyDependsOn no longer considers target artifacts of products that the processed product depends on. The new property explicitlyDependsOnFromDependencies can be used for that purpose. Change-Id: I47a80699fe881d4075b292ad164dd6e776049a83 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix size_t/int size difference warningsJoerg Bornemann2018-05-081-1/+1
| | | | | Change-Id: I1f22a986cdb581cdd968b6f09bde4fe46d7f97f4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Properly handle Rule.excludedInputsChristian Kandeler2018-04-301-2/+3
| | | | | | | | | ... when dealing with inputs from dependencies. This amends baa09164ae. Change-Id: I54154a1a3b6c797501fc8fd77c0e312f4460b0a8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make ResolvedProject::products a vectorJoerg Bornemann2018-04-271-3/+3
| | | | | | | The value_type is not suitable for QList. Change-Id: If72af8998e9e1da37c8451bc6dc5925079be43dd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Print debug output when the project's "dirty" flag is writtenChristian Kandeler2018-04-261-2/+15
| | | | | Change-Id: I67bac50beea4efb572b3299137ef52dc725647ee Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix false positives in change tracking of exported modulesChristian Kandeler2018-04-121-4/+6
| | | | | | | ... by sorting some data structures. Change-Id: I59b0244d9e489e2d4445846f6a8c796e603837c5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix and rename the excludedAuxiliaryInputs propertyChristian Kandeler2018-04-051-1/+1
| | | | | | | | | | | | | | | | | | This property did not only exclude auxiliary inputs, but all kinds of inputs ("inputs", "auxiliaryInputs", "explicitlyDependsOn"), which happens to be what we want, as it does not appear to make any sense to exclude only tags from one of the relevant "input-like" properties. But the behavior was inconsistent: When building the (product-local) rule graph, the property was considered, but not when collecting artifacts from other products during rule application. This is now fixed. [ChangeLog] The excludedAuxiliaryInputs property of the Rule item has been renamed to excludedInputs. The old name is deprecated. Change-Id: Id7eae3461a6e85f53b3d47750d296c3e47a18a95 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Merge 1.11 into masterChristian Kandeler2018-02-161-1/+3
|\ | | | | | | Change-Id: I9603ade37a1f839019c9219c940dcbb95c1cac89
| * Fix connection to rules of dependenciesChristian Kandeler2018-02-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | ... for the case that auxiliaryInputs or explicitlyDependsOn contains "installable". They must be considered in addition to inputsFromDependencies, because they also match target artifacts of dependencies. Change-Id: Ib960001a8e67034d6d1382bacc385bdcd9ddfb99 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Get rid of redundancies between load() and store() methodsChristian Kandeler2018-02-161-6/+3
| | | | | | | | | | | | | | | | | | | | It's silly that we have to mention each serializable data member in both the load and the store methods. Instead, whenever possible, forward these methods to a template that calls the right function in the persistence backend based on its parameter. Change-Id: I00e2dee8cdf55405f447cee27190bc97df8673e3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge 1.11 into masterChristian Kandeler2018-02-021-1/+1
|\| | | | | | | Change-Id: Id4986b2170ac13bf8931656659f6f60432cdbe8d
| * Project loading: Remove unneeded set insertionsChristian Kandeler2018-01-261-1/+1
| | | | | | | | | | | | | | | | | | We would iterate over the (potentially large) global set of file dependencies and try to insert each element into the same set again. Change-Id: Ib83fb0ac66bf75aee3ddc80e4c3abd18a8f77e8b Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Make ProductBuildData a proper class with accessors and modifiersChristian Kandeler2018-01-231-12/+9
|/ | | | | | | | We will need to keep track of some mutating accesses in a follow-up change. Change-Id: I8b3c92f6cca0f5dceb35ef7559cc1357cdf38656 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove as many dynamic_casts as possibleChristian Kandeler2017-11-301-21/+22
| | | | | | | | According to our benchmarker, this speeds up rule execution by three per cent. Change-Id: Iaf146ba6073b897d19e0fe470d7b0dc4a04d264c Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Modernize variable declarationsDenis Shienkov2017-11-301-1/+1
| | | | | | | | Use 'const' and 'auto' keywords more where static_cast is used. Change-Id: I60152b90fe5e44aa1ca513b43f133e604ed6417f Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* corelib: Gather string constants in central placeChristian Kandeler2017-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same string literals appeared over and over again in the code base, causing redundancy in the sources as well as at run-time. We now give them a name and make sure they get instantiated at most once. String literals that occur only once are converted from QLatin1String to QStringLiteral unless they appear only in contexts that make use of QLatin1String overloads or they are clearly outside of any hot code paths. This seems to result in small, but measurable performance improvements, even if we assume the 1% changes to be noise: ========== Performance data for Resolving ========== Old instruction count: 3266514138 New instruction count: 3209355927 Relative change: -2 % Old peak memory usage: 29649896 Bytes New peak memory usage: 29436264 Bytes Relative change: -1 % ========== Performance data for Rule Execution ========== Old instruction count: 3367804753 New instruction count: 3319029596 Relative change: -2 % Old peak memory usage: 19577760 Bytes New peak memory usage: 19091328 Bytes Relative change: -3 % ========== Performance data for Null Build ========== Old instruction count: 608946535 New instruction count: 604566001 Relative change: -1 % Old peak memory usage: 14606384 Bytes New peak memory usage: 14579936 Bytes Relative change: -1 % Change-Id: Ia055a52e0a4b6fe6fd0f1e7ba4bfa583cba1b0ef Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Replace 'foreach' macro with range-based 'for'Denis Shienkov2017-11-241-4/+4
| | | | | Change-Id: I34479bc9673d0202363aeba5c7919efc8f0d7287 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Share ScriptFunction objects between productsChristian Kandeler2017-11-231-1/+1
| | | | | | | | | | | 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>
* STL compatibility: use push_back() instead of append()Jake Petroules2017-11-221-2/+2
| | | | | | | | | | ...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>
* STL compatibility: use empty() instead of isEmpty()Jake Petroules2017-11-161-2/+2
| | | | | | | This is a simple find and replace with manual sanity check. Change-Id: Iab6d46dcc3be246d1650aae2b1730f933b717be8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* STL compatibility: use size() instead of count()Jake Petroules2017-11-151-1/+1
| | | | | | | This is a simple find and replace with manual sanity check. Change-Id: Ia733befe7885dc3c643d5c84e151312bfd86a3c6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add missing override keywordsJoerg Bornemann2017-09-191-2/+2
| | | | | Change-Id: I647a04501fbc279d0434d9b8a6160dad1a4f907e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Remove unused member of CreateRuleNodesJoerg Bornemann2017-08-031-4/+3
| | | | | Change-Id: I5ce49b3bfd561aea8d9e34c76a4d47d82446785a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Make it possible to add file tags to generated artifactsJoerg Bornemann2017-08-031-0/+1
| | | | | | | | | | | | | | | | | To add another file tag to an application one can write Group { fileTagsFilter: ["application"] fileTags: ["my_additional_tag"] } [ChangeLog] It is now possible to add file tags to generated artifacts by setting the fileTags property in a Group that has a fileTagsFilter. Change-Id: Iac977011073defd532d82f015d93970e27a66ba3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Centralize conversion of multiplex id to human-readable stringChristian Kandeler2017-08-031-9/+2
| | | | | | | | | | | ... and use it to construct a unique product display name that can be used in error messages and so on. [ChangeLog][API] Introduced ProductData::fullDisplayName() Change-Id: I9a35765d3694a8f24741f1506b00d499a1aa23a0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Use categorized logging for the build graphJoerg Bornemann2017-08-021-32/+21
| | | | | | | | | | | Use Qt's categorized logging feature for debug and trace messages in the build graph part of the library. This greatly simplifies the code as we do not have to check explicitly for the log level, and we do not have to forward a Logger object. Change-Id: If44b9ef74ebb2c4670c25e513ec58e1419588196 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove dead codeJoerg Bornemann2017-07-271-8/+0
| | | | | | | We do not need to track leaves when creating rule nodes. Change-Id: Ice98ce4021801e1be83f84b0b6a3ca7a6d3afa8c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Make Rule.auxiliaryInputs consider outputs of rules in dependenciesChristian Kandeler2017-06-301-2/+9
| | | | | | | | | | | | | | | ... and do the same for Rule.explicitlyDependsOn. Users had to write custom rules to prevent a race condition if their C++ sources pulled in headers generated as target artifacts of other products. This patch fixes that. [ChangeLog] A rule's "auxiliaryInputs" and "explicitlyDependsOn" tags are now also matched against rules of dependencies, if these rules are creating target artifacts. Task-number: QBS-1113 Change-Id: I78b84a7be9cff57145b7fb4e52fdbcd588f94640 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace QSharedPointer/QWeakPointer with std::shared_ptr/std::weak_ptrJake Petroules2017-05-231-5/+5
| | | | | Change-Id: I2915c578968bed425a8d8b617b56df88ed3f2882 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Switch to a new multiplexing approachJoerg Bornemann2017-05-231-0/+1
| | | | | | | | | | | [ChangeLog] Added a more general way of multiplexing products to properly support the creation of collections of multiple variants of the same product, e.g. macOS bundles and Android packages. Task-number: QBS-192 Task-number: QBS-912 Change-Id: I943aaa70953bf8c7726fe1b2bbb9b4d5a25f083c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix error message about conflicting artifactsChristian Kandeler2017-03-081-1/+1
| | | | | | | We printed the wrong code location for one of the products. Change-Id: I62364947220deccd2c176fe979dab4a1e58caa4b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use range-based for loops instead of iteratorsChristian Kandeler2017-02-231-2/+2
| | | | | | | ... where it makes the code simpler. Change-Id: I64cc2bf3c9be80ad7a34529bff2f98f0a466e9f8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove all usages of Q_FOREACH from the libraryChristian Kandeler2017-02-211-13/+13
| | | | | | | | This will make it easier to experiment with exchanging Qt containers for STL ones, for instance. Change-Id: Ie591fa54b5241ad4841b1ebcfb78b72932cd2b38 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Reduce overcautious rule connectionsJoerg Bornemann2017-02-061-88/+39
| | | | | | | | | | | | | | Before, we connected all leaf rules of a product with all root rules of its product dependencies. This is not necessary and penalizes parallel builds of dependent products. Now, we connect all rules of a product with all compatible rules of product dependencies. Rules that take "installable" as input still use the old behavior, because "installable" is a magic tag with no corresponding rule. Change-Id: Ib1f8b8854bf9d265c155f0d34d321c0e10607c1d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Make scanning information persistentChristian Kandeler2017-01-101-0/+2
| | | | | | | | | This way, a change in some artifact or dependency will not cause re- scanning of tons of other header files anymore. Task-number: QBS-1052 Change-Id: I1713da416b47b19275641cbbacd0a5c9da866578 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Give the two copies command.{cpp,h} non-ambiguous namesJake Petroules2017-01-051-1/+1
| | | | | | | | | | | The pair in tools/buildgraph becomes rulecommands.{cpp,h} The pair in parser becomes parsercommand.{cpp,h} This resolves a conflict which prevented compilation of the entire set of qbs sources with MSVC and the /Fo option. Change-Id: Ic909d02a230d8e59f3bf4d00fc895bf54739961a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use a sorted vector rather than QSet or std::setChristian Kandeler2017-01-051-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | ========== Performance data for Resolving ========== Old instruction count: 2324724447 New instruction count: 2317712921 Relative change: -1 % Old peak memory usage: 21411584 Bytes New peak memory usage: 21070552 Bytes Relative change: -2 % ========== Performance data for Rule Execution ========== Old instruction count: 4231322611 New instruction count: 4246208129 Relative change: +0 % Old peak memory usage: 19239000 Bytes New peak memory usage: 18181072 Bytes Relative change: -6 % ========== Performance data for Null Build ========== Old instruction count: 542161499 New instruction count: 505511534 Relative change: -7 % Old peak memory usage: 13599040 Bytes New peak memory usage: 11892952 Bytes Relative change: -13 % Change-Id: I36b3dbd3fd2a4bc7503ee7779d31bd0217000785 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* PersistentPool: Prevent access to raw data streamChristian Kandeler2016-12-161-6/+3
| | | | | | | | | | | | | | Instead, we employ our now-generic load/store interface for all serialization operations. The advantages are two-fold: 1) It can no longer happen that carelessly written store() functions mistakenly dump unshared strings into the build graph, as it has happened several times in the past. 2) We get rid of enormous amounts of custom code dealing with container (de)serialization. All of this is now done centrally by a handful of templates in PersistentPool. Change-Id: Ib1262da50989edda9726abd7d5a8ffdceaa0ec76 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fully templatize the PersistentPool classChristian Kandeler2016-12-151-5/+3
| | | | | | | | | | | The old implementation was a wild mix of templates, overloads and, worst of all, implicit assumptions about the types of container items. This combination made it close to impossible to add support for serializing generic containers. Now we have a sensible interface that we can build upon. Change-Id: I82806eaf535c16fc861bededf1b06c681d2128c0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Do not use fromLocal8Bit() for string literalsKai Koehne2016-11-081-2/+2
| | | | | | | | | | The current locale encoding does have nothing to do with string literals. Use fromLatin1(), which tends to be the fastest for ASCII. Change-Id: I9f1ff603f26812a63e5b23a413ba240c47d5ac23 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>