aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scanner/cpp
Commit message (Collapse)AuthorAgeFilesLines
* Avoid some deprecation warnings for QLatin1Literal useshjk2019-07-221-8/+8
| | | | | Change-Id: I8fe64c2ab78b1cf2e1af2a6aa2dad201299a0a94 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix uninitialized variablesIvan Komissarov2019-05-022-8/+8
| | | | | | | | | 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>
* C++ scanner: Register for rc filesChristian Kandeler2019-01-171-1/+1
| | | | | | | | Windows resource files can have #include statements. This was either overlooked from the beginning or we broke it at some point. Change-Id: I3483e8caf352f557768429cf3c4f9b3293fec38d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* C++ scanner: Properly handle UTF-8 byte order markChristian Kandeler2018-05-301-0/+10
| | | | | | | | | | | | | | Includes in the first line of a source file starting with a byte order mark would not get detected, resulting in failure to recompile after a header file change. Skip over the BOM before passing the data to the lexer. Task-number: QBS-1348 Done-with: Ola Røer Thorsen <ola@silentwings.no> Change-Id: I894a5b1667e49be5f8ce9b5cc66e4e796fd073f1 Reviewed-by: Ola Røer Thorsen <ola@silentwings.no> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Do not register the C++ scanner for header filesChristian Kandeler2018-05-071-1/+1
| | | | | | | | We only ever want to scan headers as part of recursively scanning a source file. Change-Id: Id6e9edf50b1af231839d55d29e1de08a1aba25f3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Modernize variable declarationsDenis Shienkov2017-11-301-4/+4
| | | | | | | | 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>
* STL compatibility: use push_back() instead of append()Jake Petroules2017-11-221-1/+1
| | | | | | | | | | ...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>
* Use nullptr to initialize the pointersDenis Shienkov2017-11-202-10/+10
| | | | | | Change-Id: I59d743f585410cb5c00d36a7b6f9a3e9d696d19e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> 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>
* Replace QScopedPointer with std::unique_ptrJoerg Bornemann2017-10-131-4/+4
| | | | | | | | Now only one unique pointer class is used. Change-Id: Ic03106d02614f14b120a316c1fbbf27c8caec8f2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Transform the scanner plugin manager into a true generic plugin managerJake Petroules2017-06-133-10/+15
| | | | | | | | | | | | ...and fit the generator plugins into this new plugin structure. Plugins are now handled entirely by the build system in a generic manner and no part of qbscore (code or build files) has a direct reference to any plugin regardless of whether qbs is being built as shared or static libraries. Change-Id: I4a20546ce275df71083ee22c2cb67f781c4de764 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Qt support: Scan also cpp files for Q_PLUGIN_METADATAChristian Kandeler2017-04-281-3/+3
| | | | | | | For some reason, that was only done for headers. Change-Id: Ia5d57cb68efdda0e1288fea3bd285e656b24b94b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix warning about conversion from size_t to intJoerg Bornemann2017-01-271-2/+2
| | | | | | | | 64 bit MSVC rightfully complains about a possible data loss when converting from size_t to int. Change-Id: I1f2dab2a92f978ac7e642d2d1fe7f4ebf559e912 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Change style of #includes of Qt headersJake Petroules2017-01-041-6/+5
| | | | | | | | | | | | | | | | By using q<lowercase>.h headers, we become more bootstrap-friendly, as no full syncqt is required any more. In the same go, prefix all includes with the module name. This helps grep-based analysis of which parts of Qt are used and where. It's also consistent with Qt's public headers (where syncqt enforces the style). Testdata and examples are excluded from the change, as they are not relevant for bootstrapping. Change-Id: I9539b1d795e87fca6e5fc6c91acbb775b79208d9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge the C/C++ include scannersChristian Kandeler2016-12-191-114/+17
| | | | | | | | | | | | | | | | | | | We had one scanner for every type of file in the C family, all of which collected the same set of includes, but under a different entry in the scanner cache. Thus, lots of header files were unnecessarily re-scanned. We fix this by making the scanner plugins declare a *list* of tags they can handle and passing the currently active tags in the open() function. ========== Performance data for Rule Execution ========== Old instruction count: 3775190973 New instruction count: 3441085735 Relative change: -9 % Old peak memory usage: 18174216 Bytes New peak memory usage: 17307600 Bytes Relative change: -5 % Change-Id: I222d1ec4bbfbc06ecd8c81faa55a500bc0da1ee6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Allow scanner plugins to be built staticallyJake Petroules2016-12-162-3/+5
| | | | | | | | Scanner plugins will now also be built statically when Qbs is built against a static Qt, enabling single-binary distributions. Change-Id: Id2587b79815bcc6d9ec569f5b168445fe7e843d3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fully qualify referencesJake Petroules2016-11-302-4/+5
| | | | | | | | This helps with building an "amalgamation" build of Qbs where all source files are concatenated. Refereneces to these symbols are otherwise ambiguous. Change-Id: If8cb43b7822fc02df4957a9b5f6b132eae749d7a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge 1.6 into masterChristian Kandeler2016-09-303-2/+6
|\ | | | | | | Change-Id: I5a0de1ab1c38080d6061045d28fa9220a88ef4ba
| * Handle Q_NAMESPACEBogDan Vatra2016-09-283-2/+6
| | | | | | | | | | | | | | Q_NAMESPACE will be introduced in Qt 5.8 which is used to add metafinfo to a namespace Change-Id: I16eacc488e9d9705305ced0847d3ad7bc8557292 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Update license headersIikka Eklund2016-08-293-42/+69
| | | | | | | | | | | | | | | | | | | | Patch-set 2 includes *.cpp *.c Every source file needs to have up-to-date license headers in order to pass ci. Change-Id: Ie6e493097af6f7dd6a8adff170eb856f496e689e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Update license headersIikka Eklund2016-08-294-56/+92
|/ | | | | | | | | | Patch-set 1 includes *.h Every source file needs to have up-to-date license headers in order to pass ci. Change-Id: Ib6cf3ac47dfba6dff262fded44bc952aef3bda8b Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Fix change tracking for precompiled headersChristian Kandeler2016-08-011-1/+48
| | | | | | | | | | | | We used "explicitlyDependsOn" in the respective rules to make the pch sources depend on all header files. This was much too coarse, as it meant that the precompiled header was rebuilt whenever any header file in the product changed. Instead, we need to scan the pch sources just like all the other C and C++ source files to find out which header files they actually depend on. Change-Id: Iaec4ed85075b387d9f4b0fcd06b1e481851c6b10 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Replace 'the Qt build suite' with 'Qbs' in copyright notices.Jake Petroules2016-06-067-7/+7
| | | | | | Change-Id: I885d94bb14b325dc36767a840ebdb0be1fb59dd2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Correctly handle Objective-C++ source files in moc.Jake Petroules2016-04-061-1/+4
| | | | | | | Task-number: QBS-951 Change-Id: I692ac696f22ccc02c0db530abf66ae24a1a398fa Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* update license headersJoerg Bornemann2015-03-027-14/+14
| | | | | Change-Id: I36d825db3a5ef32c162c3063aab1e8a1f2696f4f Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Update LicenseEike Ziller2015-01-267-42/+42
| | | | | Change-Id: I092fca9f950de1ba38826c33b155f86feae2770b Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* License update.Eike Ziller2014-10-167-49/+56
| | | | | | | Add LGPLv3 option. Change-Id: I8a63ad5e46a2701032b2103f791df4dec5b707e8 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* support transformers with an unknown number of outputsJoerg Bornemann2014-02-131-1/+1
| | | | | | | | | | | | | | | | To support different types of nodes in the build graph, we introduce the base class BuildGraphNode. Artifact now derives from BuildGraphNode. A RuleNode class is introduced that represents a rule in the build graph. Rules are applied in the build phase and not in a pre-build phase anymore. The handling of moc has been revisited. The fixed automoc pre-build phase is no more. This is the squashed merge of a feature branch. Task-number: QBS-370 Change-Id: If27cdc51cba8c9542e4282c2caa456faa723aeff Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Merge remote-tracking branch 'origin/1.1'Joerg Bornemann2014-01-097-7/+7
|\ | | | | | | Change-Id: Iccf01f1dad3fca4a78c7d9b795fdef6df0181e9b
| * Incremented year in copyright infoRobert Loehning2014-01-087-7/+7
| | | | | | | | | | | | Change-Id: Ib7f9a00bb891fa39c5bc1f891ddbfba1e4d23227 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | use memcmp instead of strncmp in C++ scannerJoerg Bornemann2013-12-041-1/+1
| | | | | | | | | | | | | | | | We already know the actual string length, so there is no point in having the function figure it out itself. Change-Id: I34303ba07e46c634dac42228479ed59ae2966592 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | correct equality checks in C++ scannerJoerg Bornemann2013-12-031-13/+19
| | | | | | | | | | | | | | | | Instead of checking whether an identifier starts with a literal, we're checking for the exactly matching string. Change-Id: I944e0e204b977e661f68debb3a47aad76da69363 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | check for defines in C++ scannerJoerg Bornemann2013-12-021-12/+21
| | | | | | | | | | | | | | | | We must ignore Q_OBJECT, Q_PLUGIN_METADATA and friends, if there's a "define" identifier in front of them. Change-Id: Ica198e16f1ab5855db490fd67967d31d7b3b1a06 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | make code in cppscanner more readableJoerg Bornemann2013-12-021-7/+11
|/ | | | | Change-Id: Ie7821003fa8004a21ebc5847b7f79fa40ac7fa53 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix cppscanner file type passingJoerg Bornemann2013-08-301-5/+3
| | | | | | | Without the proper file type, Q_PLUGIN_METADATA wasn't found anymore. Change-Id: I9f753422fd8fd388f9e8c5a4ba1d49543dc45382 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* AutoMoc: do not scan files twiceJoerg Bornemann2013-08-271-1/+1
| | | | | | | | We scanned files for the Q_OBJECT macro and then again to find moc_XXX.cpp includes. This can be done in one pass. Change-Id: I3b14be2a922ce244730b3ce21e7803c605ba59be Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* don't pass file tags to scanner pluginsJoerg Bornemann2013-08-271-21/+21
| | | | | | | The scanners already know the file tags they're responsible for. Change-Id: If5ed47bfc011357737df08e3fe834ec8fcf4318b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* add qbs files to build qbsJoerg Bornemann2013-03-151-0/+18
| | | | | Change-Id: I3aca8364a58ac26a495909c0313f8f0588784b9f Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Allow fine-grained tuning of installation.Christian Kandeler2013-03-131-8/+1
| | | | | | | | | | - Potentially different prefixes for libs and plugins/modules. - Make it possible to disable installation of development files (headers, qbscore.lib on Windows). Change-Id: Ia153d17835f9f1b8d802b23c3689a2f72f656e50 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Install the plugin libraries and share/qbsAlejandro Exojo2013-02-221-0/+3
| | | | | | Change-Id: I003f991cb143de6af87a7b9a058cbb41efcbf50e Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* do not scan qrc dependencies recursivelyJoerg Bornemann2013-02-061-6/+6
| | | | | | | | | | | | | | | | | | | The files referenced in a qrc file must not be scanned for further dependencies. Assume the following situation: - foo.qrc references bar.cpp, - bar.cpp includes bar.h We do not want to regenerate qrc_foo.cpp when bar.h changed. ScannerPlugin::usesCppIncludePaths has been turned into the flag ScannerUsesCppIncludePaths. We introduce the scanner flag ScannerRecursiveDependencies. If this flag is set, then every scan result is added to the list of file to scan. Typically, this will be set for include-file-like dependencies. Change-Id: I99e04f554fc34db3e0b90610bb3d20f7e6000c57 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* rename cpp.cpp to cppscanner.cppJoerg Bornemann2013-02-052-1/+2
| | | | | Change-Id: Icfa2213b364b5eed8065fccb565ac6166449a5eb Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* update copyright yearJoerg Bornemann2013-01-097-7/+7
| | | | | Change-Id: Ic2962e57ede037b910d7e77b01b0163f0a22cb7d Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix MSVC buildOrgad Shaneh2012-11-191-1/+1
| | | | | Change-Id: Icb8ea583b5a1a4303550e5482ecdccc674522267 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* cleanup .pro filesJoerg Bornemann2012-11-161-2/+1
| | | | | | | | Do not use DEPENDPATH but CONFIG+=depend_includepath. Do not add "." to INCLUDEPATH. Change-Id: I3532833aef13d32f8278074283fcd12256d38143 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Fix warnings about unused variables in C++ lexer.Christian Kandeler2012-10-181-12/+12
| | | | | Change-Id: I8331ff95f5b3c80e15cd71dbce2bb6de17a49c8e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* license and copyright updatedJoerg Bornemann2012-10-087-197/+141
| | | | | | Change-Id: I0c0b3035514ee6b735e85c098029fa2f41edb6ff Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* support Qt5 plugin metadata json filesJoerg Bornemann2012-10-081-11/+24
| | | | | | | | | | | | For the metadata .json files of Qt5 plugins, qbs now supports the qt_plugin_metadata filetag. C++ header files are scanned for the Q_PLUGIN_METADATA macro. If it is found, the qt_plugin_metadata file is added to the dependents of the resulting moc_XXX.cpp file. Change-Id: I4b68fd9a99847640f87a40e15819382ead74b0d3 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* fix warnings in cpp scannerJoerg Bornemann2012-09-261-2/+2
| | | | | Change-Id: Iae82ac9c456e994ef9764ea897a9a902e11bfbf5 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Added include parser support for ObjC++ and ObjCRuslan Nigmatullin2012-09-201-4/+30
| | | | | Change-Id: I749bee8a6ad3f03a6fa63432d88ccf4c322fad6d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>