aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/language
Commit message (Collapse)AuthorAgeFilesLines
* C++: Add support for clang on WindowsChristian Kandeler2019-08-141-1/+12
| | | | | | | | | | | | | This is about clang in "mingw mode", not clang-cl. When targeting Windows, clang is a lot like mingw, so factor out the common parts into a new base module. Testing uncovered a number of invalid assumptions in our autotests, which are also fixed in this patch. In addition, minor adjustments had to be made to the Qt.core module and to the qbscore lib. Change-Id: I73085dc62a65e2a9d0397cf234c8641989246f22 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Work around deprecation warnings in Qthjk2019-07-243-3/+4
| | | | | Change-Id: Iff45f56fc91f3d513440a3e2aaf519a7aa0f7744 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge 1.13 into masterChristian Kandeler2019-05-232-2/+11
|\ | | | | | | Change-Id: Ic8e80604deb03e48fe264271de2e0add5023af87
| * Fix module provider bug in IDE modeChristian Kandeler2019-05-232-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When re-resolving a project with an existing in-memory build graph, we must make sure that the old project object does not remove the generated modules from the build directory in its destructor. This fixes the following bug in Qt Creator: - Open a project initially (but do not build). - Edit the project file and re-resolve. - Build the project. This now fails, because the generated modules were erroneously removed in step 2. Change-Id: If6c1c1ed986e8f00e4d89ba5525bac7e032388d9 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* | Apply modernize-loop-convert fix-itIvan Komissarov2019-05-212-8/+7
| | | | | | | | | | | | | | Makes clang-tidy happier Change-Id: Ic29b552572719ea58c7ad385cc6e1d68cef9eedc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Use std::vector in ItemPoolhjk2019-05-162-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Is: text data bss dec hex filename 11490 8 0 11498 2cea itempool.o Was: text data bss dec hex filename 12425 8 0 12433 3091 itempool.o-orig Also, less symbols. Change-Id: I6f90b126933f5fa6d00f5e1097faaa4276613a6a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add missing virtual destructorsIvan Komissarov2019-05-032-0/+2
| | | | | | | | | | Change-Id: I6a20f4475b52858f79c98b5ce3dd088aac7bc46e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Apply fix-its for the missing override keywordIvan Komissarov2019-05-032-2/+2
| | | | | | | | | | | | | | | | Missing override is a warning in clang Change-Id: I90b899df37e690aebb942bffc65db54d9aa4050f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix uninitialized variablesIvan Komissarov2019-05-027-42/+38
| | | | | | | | | | | | | | | | | | This fixes most of clang analyzer warnings about uninitialized variables in ctors Change-Id: I879c785594307ed3fe7140588338a6b2a1e4db65 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Use pass-by-value and moveIvan Komissarov2019-03-0712-25/+27
| | | | | | | | | | | | | | This fixes -Wmodernize-pass-by-value Change-Id: I85a732867866e43c39c1d77937fbc645433c96bd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix calls to non-const begin()/end() in range-for loopsIvan Komissarov2019-03-065-12/+21
|/ | | | | | | | This fixes -Wclazy-range-loop Change-Id: I08a435b700017cdbe27fbfdbda6e26840d9a3568 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Return initializer list where it is possibleDenis Shienkov2019-02-2610-31/+31
| | | | | | | | | This fixes this clang-tidy warning: warning: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list] Change-Id: I421e1e47462fe0e97788672684d47943af7df850 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use QStringLiteral more where it is possibleDenis Shienkov2019-02-258-81/+81
| | | | | | Change-Id: I7419cc3fbc1e8776de3943852dcedab4c95d1c32 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace 'typedef' with 'using' where it is possibleDenis Shienkov2019-02-2310-57/+57
| | | | | | | | One exception is that the 'typedef' for function pointers were skipped due to an additional work is required. Change-Id: I2112fded3abeaee1d1f49f56adfd2914d5db0324 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use 'const auto' keywords more at objects allocationsDenis Shienkov2019-02-232-2/+2
| | | | | | Change-Id: I592d433e7c473ae9f27ca08e701516efe53650ba Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add const-references for non trivial types in range-for loopsIvan Komissarov2019-02-201-3/+3
| | | | | | | This fixes -Wclazy-range-loop Change-Id: I5424d2626d6134ac7be2ce70b83f5a617f58dd7e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Module providers: Always remember that a provider was runChristian Kandeler2019-02-111-2/+6
| | | | | | | | ... even if it did not succeed. Otherwise, other products will try again, even though we know it won't succeed. Change-Id: I6c4f14df33ecbc9b38ec8cae7e1c2d6bfc99816a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Module providers: Fix some change tracking problemsChristian Kandeler2019-02-117-19/+39
| | | | | | | | | | | - We must not remember our temporary files. - We need to use a different reference time stamp for the created modules. - Collecting the results of File.exists() & friends can lead to false positives, so we disable it for now. Change-Id: Id64685b510606f1991e83eb825c36a1b3ec4a4e1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* ModuleLoader: Do not validate property bindings in non-present modulesChristian Kandeler2019-01-241-0/+21
| | | | | | | | | | The check for the "not-present" condition was not thorough enough: If a module was successfully loaded, but its validate script failed, then we'd still check property assignments if they happened from within a higher-level module instance. Change-Id: I9d7281eb5603deaa04db008ab9fc340847d83151 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Introduce module providersChristian Kandeler2019-01-2313-22/+395
| | | | | | | | | | | | | | | | | | | | | | If a dependency is not found, we now search for a matching module provider that can generate one for us. We also provide a generic fall-back provider which uses pkg-config to locate the dependency (but could be extended to incorporate other methods in the future). This is the most important part of this change for practical purposes, as it makes hundreds of popular libraries available for use in qbs projects without users having to write any boilerplate code. In a future patch, a module provider could also be used to implement the functionality of the qtprofilesetup library, relieving users of the need to create a profile for building Qt applications. [ChangeLog] The Depends item now falls back to pkg-config to locate dependencies whose names do not correspond to a qbs module. Fixes: QBS-1107 Change-Id: Ifd4f05c237cf58cd9fe707c3da648d3dbb33e82b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Do not ignore file dependencies in the Scanner itemChristian Kandeler2019-01-181-1/+2
| | | | | | | We used to look only at artifacts when scanning recursively. Change-Id: I39f968c05dd3e6af362bf3bb98380814b01de172 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge 1.12 into masterChristian Kandeler2019-01-111-2/+4
|\ | | | | | | Change-Id: Id535625f198f10a920f32e198d39b38d46b35668
| * ModuleLoader: Fix possible crash in verbose mode1.12Christian Kandeler2019-01-071-2/+4
| | | | | | | | | | | | | | | | The assumption in the code that a value is always a JSSourceValue is not (anymore?) true. Change-Id: Ie1056913d4817776f5ce483f4fb0f60144cda9c6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | ModuleLoader: Fix compiler warningChristian Kandeler2019-01-081-1/+1
| | | | | | | | | | | | | | | | | | Recent GCC warnings emitted a warning about an unneeded copy in a template. Fix this by using std::forward(). Change-Id: I9b52c10d19a09c169d7d354aa6b79c51874f74e9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge 1.12 into masterChristian Kandeler2018-12-172-4/+5
|\| | | | | | | Change-Id: I44f8e2c5f3fbe8fc67deada65a4136257572239e
| * Fix bogus error about duplicate source filesChristian Kandeler2018-12-132-4/+5
| | | | | | | | | | | | | | | | | | There is no conflict if the same file is pulled in both as a target artifact of a module and a normal source file. Fixes: QBS-1416 Change-Id: Ic7467af5a8728ebb1540381c845ffc0f40e06a9c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge 1.12 into masterChristian Kandeler2018-10-261-0/+2
|\| | | | | | | Change-Id: I5cf41522f027adac0889dc1df96613012216f092
| * Do not try to evaluate the properties of non-present modulesChristian Kandeler2018-10-221-0/+2
| | | | | | | | | | | | | | It's unnecessary and potentially harmful. Change-Id: Iff5a9a52a7aeb518617104c5eaa41cfeededbea5 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | Merge 1.12 into masterChristian Kandeler2018-10-121-1/+0
|\| | | | | | | Change-Id: I96c735aeda89e02f1fa9107ecfc10ebf4b554dbc
| * Remove bogus assertion from Properties item handlerChristian Kandeler2018-10-111-1/+0
| | | | | | | | | | | | | | | | | | It does not appear to serve a purpose, and it prevented deriving from the Properties item. Change-Id: Icf71e3358299ea7a0f697637967e65dd0fb9b743 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge 1.12 into masterChristian Kandeler2018-09-042-4/+4
|\| | | | | | | Change-Id: Ia115255ae46772a83c1196fbe291ff295927ee92
| * Fix invariant in the RequestedArtifacts classChristian Kandeler2018-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | If an artifact map is requested a second time, we need to update the set of all tags if the artifacts map has changed in the meantime. This fixes an assertion in the sanity checks. Change-Id: Iacf8d4376c7a3a356428cc7eb508dbd22e945a8c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * ModuleLoader: Fix memory leakChristian Kandeler2018-09-031-2/+2
| | | | | | | | | | | | | | One of the allocations was not exeception-safe. Change-Id: Ib367f9f2e5e65d0813465d5dcbf9dc779418bdfc Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Filter references to importingProduct from exported list propertiesChristian Kandeler2018-09-042-10/+21
| | | | | | | | | | | | | | | | It's just a heuristic, because we don't have access to single elements of JS arrays, but it should cover the most common cases. Change-Id: I02f9ff215394d108f7ba52662eff7b4f5e8e1a62 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge 1.12 into masterChristian Kandeler2018-08-313-15/+8
|\| | | | | | | Change-Id: I745a07a3b25abd6c89afcd3b2199119a751e8a0c
| * Store product names in ExportedModuleChristian Kandeler2018-08-313-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | ... rather than product pointers. ExportedModule objects can be stored in Transformers, which potentially outlive the referenced products. Alternatively, we could update the product pointers during change tracking, but that would be tedious and error-prone. [ChangeLog] Fixed possible crash on storing a build graph after re- resolving. Change-Id: I09bcf638a17da410198524858eb4c1bda59bebcb Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | corelib: Apply modernize-use-nullptrAlessandro Portale2018-08-204-9/+10
| | | | | | | | | | | | | | Use nullptr instead of 0. Change-Id: Id5b7933844730e244a2dcf3fcebf24f9f048047f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | corelib: Apply modernize-use-overrideAlessandro Portale2018-08-204-10/+11
| | | | | | | | | | | | | | Add overrides to function, except for destructors. Change-Id: I1a1337b01dfef81b74ba56c5f00bf4d4cfc10935 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | corelib: Apply modernize-use-autoAlessandro Portale2018-08-203-5/+5
| | | | | | | | | | | | | | Use more auto. Change-Id: I27e1e2345c6bede459a375663be72ec3370a5e39 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge 1.12 into masterChristian Kandeler2018-08-102-25/+11
|\| | | | | | | Change-Id: I20256cb4a06cab8d191e389f08d77ace82e4d6b9
| * Fix potential false caching of module prototypesChristian Kandeler2018-08-102-25/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our code assumed that products with the same profile and the same multiplex configuration would also evaluate a module's condition to the same value, which is not true: Properties such as qbs.architecture, which are commonly checked in module conditions, can be set in a product item independently of multiplexing. We now evaluate the module condition for every product. According to our benchmarker, the slowdown is a very modest 2% and does not appear to increase for larger projects. This patch amends 08ce978733, which tried to address the same problem, but succeeded only for a subset of the possible cases. Change-Id: I992e0f0d5cf207949cf5d863f242b9476ecdfc05 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * ModuleLoader: Fix edge case in Depends.productTypesChristian Kandeler2018-08-081-0/+1
| | | | | | | | | | | | | | It makes no sense to consider multiplexed variants of the same product. Change-Id: I7ebee091264451dc587156a0c543932059ed9948 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Add support for job poolsChristian Kandeler2018-08-086-4/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commands can now be assigned to an arbitrary job pool and a limit for the number of concurrently running jobs in such pools can be provided in a number of ways: - via the build command line: qbs --job-limits linker:1 - via the settings: qbs config preferences.jobLimit.linker 1 - in a project file: JobLimit { jobPool: "linker"; jobCount: 1 } We provide two job pools ourselves with the cpp module: "compiler" and "linker". [ChangeLog] Added the concept of job pools for limiting concurrent execution of commands by type Task-number: QBS-743 Change-Id: Ib3f361dbc73093e342bf0eba0daf2079a2b3a8ce Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Fix detaching a QLists in some range-for loopsIvan Komissarov2018-08-072-4/+3
| | | | | | | | | | | | | | | | | | | | | | This detach is shown as (non-persistent) allocation in an macOS Allocations tool which confuses a bit while looking at the results. Also, provides a little speedup preventing unnecessary refcounting and memory allocation. Change-Id: Ic74c53d1d49ce2289ed189aa4c5612e8cbd45eb4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Reserve corrrect amount of memory for item's childrenIvan Komissarov2018-08-072-0/+3
| | | | | | | | | | | | | | | | | | | | Due to QList grow strategy, we end with unused padding at the end of QList. Removing this padding can save a bit memory because this function is frequently called for huge projects. Task-number: QBS-120 Change-Id: Id5a3836b36c03e59d885d77a87a969e9e3784e81 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge 1.12 into masterChristian Kandeler2018-08-033-2/+39
|\| | | | | | | Change-Id: I0ce6c28f9117f945c9fec0654bd06daf3d13ace0
| * ModuleLoader: Suppress bogus subsequent errorsChristian Kandeler2018-07-311-1/+23
| | | | | | | | | | | | | | | | | | This is only relevant for relaxed mode (used by IDEs). We try hard not to cause bogus subsequent errors in the first place (see cadb0864c9), but in some edge cases we still run into them, and will drop them now. Change-Id: I0a12086c29f9e9f6b647902eaaf634c8ea0a094d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * Fix false positives in artifacts map change trackingChristian Kandeler2018-07-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to invalidate a script if it accessed the artifacts map and that map's keys are now different from what they were. However, that logic was too coarse: All rules that run after the command will add new artifacts, so such changes will be the norm, at least when the project is built for the first time. As a result, some artifacts might get rebuilt unnecessarily on the next qbs invocation. The reason why we did it that way was that we needed to consider the case where a script iterated over the elements of an artifacts map, e.g. using a for..in loop. In such a case, we cannot know which part of the map the code is interested in and the script needs to be re-run if the keys change. This is now solved with the help of a QScriptClass, which informs us if a script enumerates the keys. In all other cases, the script only accesses well-known tags, so we only have to compare the respective artifact lists and do not care about other keys getting added or removed. Change-Id: I182a50c34ece28f7ff3f7eba7a8f246e9b79b30e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * Make sure product type and artifact file tags are sortedChristian Kandeler2018-07-301-1/+1
| | | | | | | | | | | | | | | | | | ... when accessed from JavaScript. Due to the FileTag class being based on Id, we sometimes get a different order of elements, leading to false positives in change tracking. Change-Id: Ie2f1a2e9a229fddcd479175323dded3a80bb02e5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Make sure the set of root artifacts is always up to dateChristian Kandeler2018-07-311-2/+2
| | | | | | | | | | | | | | ... by updating it whenever artifact file tags change. Change-Id: I62496ba73f7633888de6be16aca59777a53629ed Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>