summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools
Commit message (Collapse)AuthorAgeFilesLines
* Utils: Introduce GlobalFileChangeBlockerOrgad Shaneh2019-01-084-9/+0
| | | | | | | | | | Tracks application state, and signals when it is changed. Supports forcing blocked state with reference counting. Change-Id: Ic173d42446b1b08bd4a1e7c1acf38c68644d30b3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangTools/QMake: Stop analyzing files not part of build configurationNikolai Kosjar2019-01-086-31/+34
| | | | | | | | | | | | | | | ...for the qmake project manager. When parsing the project files, remember whether a file was discovered by the exact or cumulative parse. Only files that were discovered by the exact parse are considered "active" and thus part of the build configuration. The others are not offered for selection. Fixes: QTCREATORBUG-16016 Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I7a28b4de15e048975d7f0cd737dd8c11f744315b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge remote-tracking branch 'origin/4.8'Eike Ziller2019-01-071-5/+5
|\ | | | | | | | | | | | | Conflicts: src/plugins/coreplugin/dialogs/externaltoolconfig.ui Change-Id: Ie38e9028cee599578c59b22325d85c097335243e
| * CppTools: Fix categorization of *.inl, *.tpp, and similarEike Ziller2018-12-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | These are files that are included like headers, and not compiled themselves, so e.g. adding them to a project should not categorize them as source files. Fixes: QTCREATORBUG-21736 Change-Id: I7dafba02896d12160de5eed458b99144df0a5f37 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | CppModelManager: Remove method overload used only in testsBernhard Beschow2019-01-064-13/+11
| | | | | | | | | | | | | | Use (and therefore test) the method actually used in production code. Change-Id: I4317517ef8a1779df4d46af3905790012ee98645 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | CppProjectUpdater: Remove unread attributeBernhard Beschow2019-01-062-6/+2
| | | | | | | | | | | | Change-Id: I51123e5b5609de431cfa6d1558aed0b9739ff9c8 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | QbsProject: Remove unread attributeBernhard Beschow2019-01-062-7/+0
| | | | | | | | | | | | | | | | Also remove the signal CppProjectUpdater::projectInfoUpdated() which is now unused. Change-Id: I65afe8f96cd8175edaf8ccb6e5067e4f9cd8d99f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | CppTools: More build fixesChristian Kandeler2018-12-211-2/+2
| | | | | | | | | | Change-Id: I350479c0f79869cccdf0edfd6c89d932d8f3215f Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | CppTools: Fix buildChristian Kandeler2018-12-212-1/+3
| | | | | | | | | | | | | | Amends 97828a96af and ef8de6a384. Change-Id: I9dd7d6a093657ea6f20ff3b5a4d0c968f8293ad7 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | CppTools: Add reset function to CompilerOptionsBuilderMarco Bubke2018-12-202-0/+6
| | | | | | | | | | | | | | | | It makes it easier two get different options. Task-number: QTCREATORBUG-21693 Change-Id: Ibcfa52d8bbbdf971a38fb6102a6b79e037a9cf02 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | CppTools: Adapt CompilerOptionsBuilder to HeaderPathFilterMarco Bubke2018-12-203-114/+40
| | | | | | | | | | | | | | | | | | After we moved some of the code to HeaderPathFilter we now use it in CompilerOptionsBuilder. Task-number: QTCREATORBUG-21693 Change-Id: Iea3569465bbc135d72bd88f9c23026f2ace33aba Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | CppProjectUpdater: Reuse cancelAndWaitForFinished()Bernhard Beschow2018-12-191-2/+1
| | | | | | | | | | Change-Id: I749dd0244175060ce79d6050b12b729866c06c9d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | CppTools: Compile fixhjk2018-12-171-0/+4
| | | | | | | | | | | | | | | | Amends ef8de6a384516c. Change-Id: I50dc5b63867888ed258d6dedf643c3cc33b1014c Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | CppTools: Introduce HeaderPathFilterMarco Bubke2018-12-174-2/+201
| | | | | | | | | | | | | | | | | | We went the filtering of the header path outside of the compiler options builder so merge the PCHs. Task-number: QTCREATORBUG-21693 Change-Id: Ia1126813a5049e39d7c6e7d60bf449aa17012d02 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | Merge remote-tracking branch 'origin/4.8'Eike Ziller2018-12-122-40/+36
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri src/plugins/cpptools/compileroptionsbuilder.cpp Change-Id: I87f47cecbb924064296a002fd9446a0627acad8e
| * CppTools: Return proper tab settingsIvan Donchevskii2018-12-121-2/+2
| | | | | | | | | | | | | | | | We are always interested in currentTabSettings(). Fixes: QTCREATORBUG-21280 Change-Id: I5b739b516eb985074c27410113c244787dd8b52d Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * Clang: Always force the built-in includes orderIvan Donchevskii2018-12-111-33/+32
| | | | | | | | | | | | | | | | | | C++ includes must always come first, then clang resource directory and then everything else. This prevents both c++ standard headers and intrinsics issues. Change-Id: Ia21bfa2fe99884c9adf58f7ef6beba1bede1724b Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Clang: Stop forwarding toolchain macrosNikolai Kosjar2018-12-102-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...for clang code model and clang tools use case. This means that compiler detection code will see clang now instead of the toolchain that is configured in the kit. While providing the toolchain macros worked fine for the general case, it always was problematic for compiler detection code. By not providing the toolchain macros we are more close to the real clang compiler invocation. That is, rely on clang to do the right thing. Allow to go back to old behavior with QTC_CLANG_USE_TOOLCHAIN_MACROS=1 as this will be useful checking differences for debugging. Fixes: QTCREATORBUG-19543 Change-Id: I23ffd761d83f35ca1a22269c3ef07a2dc62358bd Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | Merge remote-tracking branch 'origin/4.8'Eike Ziller2018-12-071-1/+2
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/cpptools/compileroptionsbuilder.cpp Change-Id: I743ea39480cc5c7b6febcd2e93713d15a3ae6d9c
| * Clang: Use -fms-compatibility-version with clang-cl toolchainIvan Donchevskii2018-12-031-3/+5
| | | | | | | | | | | | | | It's used while building so let's also do that in Clang Code Model. Change-Id: I4e5e3ccc71d14c8d44049672e37380af2592390f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | CppTools: Split CppTools::UseBuiltin in two optionsNikolai Kosjar2018-12-042-9/+14
| | | | | | | | | | | | | | | | | | | | ...for clarity. No behavior change. Change-Id: Id0334bc79b97a8ff53b37089e337530c9a01b1d4 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | ClangFormat: Move settings to the Code Style widgetIvan Donchevskii2018-12-045-19/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It makes sense to unify the indenter creation by replacing the CppCodeStylePreferencesFactory instead of removing it. We are reusing the same options page but with different kind of settings. With this change wizards will no more be confused by missing factory and will create the proper indenter. Fixes: QTCREATORBUG-21516 Change-Id: I38964d5fa1f2257617c66a1441db723d239a3237 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | CppTools: Fix build with MSVCNikolai Kosjar2018-12-041-2/+2
| | | | | | | | | | | | | | | | compileroptionsbuilder.cpp(196): error C2440: 'initializing': cannot convert from 'const char *' to 'QString' Change-Id: Ifa5e50ab927c534a855c2f7871d3dce87092b30a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Clang: Unify CompilerOptionsBuilder optionsNikolai Kosjar2018-12-032-15/+15
| | | | | | | | | | | | | | | | | | | | No behavior change. Sometimes we use "SkipX, sometimes "UseX". Unify to "UseX" as this is more natural to read. Change-Id: Ib08bdb4cde93ed55fdb9c855566b10a3933cae37 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | CppTools: Fix compile with older Qt / gccChristian Stenger2018-12-031-2/+2
| | | | | | | | | | Change-Id: I00656b409135ee1a84a0a372f726fdbc7c20d1e6 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | Clang: Clean up CompilerOptionsBuilderNikolai Kosjar2018-12-034-254/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No behavior change. * Remove virtual from methods that are not overridden * Move constant member functions that do no access any members into source file as static functions * Remove QLatin1String where possible * Make variable names a bit more consistent * Other minor stuff Change-Id: I34a582d5a468489e11365507b283e9aee157664f Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | Merge remote-tracking branch 'origin/4.8'Orgad Shaneh2018-12-035-3/+19
|\ \ | |/ | | | | Change-Id: I5b18233936e3b2cd674df92a694ba73b5a3ed752
| * Clang: Work around eating memory with gcc/clang/-fno-rtti/boostNikolai Kosjar2018-11-292-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Boost recognizes a misconfigured compiler in rtti emulation mode (-fno-rtti) as our libclang command line is special. Even worse, it does not seem to stop instantiating templates and allocating memory afterwards. For the former to fix, we need to rework our command line (in master). The latter can be work arounded by defining BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING with a value for gcc/clang. See also https://www.boost.org/doc/libs/1_64_0/doc/html/BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING.html Task-number: QTCREATORBUG-19543 Change-Id: Iddb5be2d1f1966018e5ab535a8f7475fe7911284 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
| * C++: Use file size limit also for included filesNikolai Kosjar2018-11-293-3/+9
| | | | | | | | | | | | | | | | | | We can't stop the clangbackend from processing huge files, but at least our built-in parser. Fixes: QTCREATORBUG-21590 Change-Id: I506024495ba0632692f2845c6c204360f4c61b33 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Merge remote-tracking branch 'origin/4.8'Eike Ziller2018-11-293-8/+12
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/android/androidrunnerworker.cpp Change-Id: Ibd8b99435365fb7e7d488313fd1d2b3a75adad1b
| * Clang: Do not call built-in follow symbol with no documentIvan Donchevskii2018-11-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | CppEditor tests (the part which works with ClangCodeModel) showed that it's possible that QTextCursor might get document reset to the moment we try to call built-in follow symbol. That means that the editor widget is closed already. Check for the document to prevent such behavior. Change-Id: I2463f4688dc6fca7f701fba243ffc6e43a573b33 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
| * Utils: Fix column number for Highlighting resultIvan Donchevskii2018-11-261-1/+1
| | | | | | | | | | | | | | | | | | Follow up for 8469e317c9. This column number compensation is not required anymore. Fixes: QTCREATORBUG-21384 Change-Id: I94da48533520471170200c592129781e5b4b614c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
| * Clang: Fix C++ paths search in compiler options builderIvan Donchevskii2018-11-211-5/+6
| | | | | | | | | | | | | | | | Take into account paths from MinGW and NDK Clang. Fixes: QTCREATORBUG-21540 Change-Id: I00906c75dc4ddeb92fe5942a0222285d8ce2eb9d Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Merge remote-tracking branch 'origin/4.8'Eike Ziller2018-11-195-10/+33
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/winrt/winrtdevicefactory.cpp Change-Id: I33b8697e2ebf2bea051d7f1144449e0743ee16a5
| * CppTools: Fix thread-unsafe call to MessageManager::write()Nikolai Kosjar2018-11-151-1/+14
| | | | | | | | | | | | | | | | | | The Preprocessor running in a worker thread can call this function. Fixes: QTCREATORBUG-21481 Change-Id: I4970379fbabae23cfa3d7c1222e81a4ae8c3e6ad Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * CppTools: Simplify the currentProjectCodeStyle codeIvan Donchevskii2018-11-131-4/+5
| | | | | | | | | | | | | | Use alias to shorten the repeating default return value. Change-Id: I673fc1d293c1612c945c80d554c6667a756108de Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
| * CppTools: Forward OpenMP extension flagNikolai Kosjar2018-11-131-0/+3
| | | | | | | | | | | | Fixes: QTCREATORBUG-21213 Change-Id: I986ab69bc44ece83a3b56f968cc3b6c3126e2c32 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
| * CppTools: Allow to check whether project code style existsIvan Donchevskii2018-11-122-7/+12
| | | | | | | | | | | | | | | | | | | | | | The calling code can anyways fallback to the global style without extra help if no project style exists. It is useful when you want to get the project style if it exists and understand at the same time that it is not a global one. Change-Id: I265de3f436f90623385427fc8a1abad09c8c3577 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
| * ClangFormat: Fix crash on exitIvan Donchevskii2018-11-121-2/+3
| | | | | | | | | | | | | | | | | | Was introduced in 0e5c7f51fa with the page being deleted to remove it from the global list of pages. Change-Id: Ia13f7ab74d85b5b8c66f1b20e33d97c29ce3e8f1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | Merge remote-tracking branch 'origin/4.8'Eike Ziller2018-11-0912-28/+74
|\ \ | |/ | | | | | | | | | | Conflicts: tests/unit/unittest/unittest.pro Change-Id: I4f0ab05f96ee60900a3a35fad4c7331238367593
| * Utils: Adjust column numbers affected by convertPosition changeIvan Donchevskii2018-11-097-28/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | convertPosition change was introduced in 931ec39f64a. It changed 0-based column to 1-based which is how it naturally is in Qt Creator. This fixed some usages but broke many more. This is an attempt to fix the remaining use cases. Fixes CppEditor auto-tests. Change-Id: Ia8d14da0ebb035cd2fdd6da4ff6ec89c1c5121a8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
| * ClangFormat: Synchronize with C++ code style settingsIvan Donchevskii2018-11-082-0/+30
| | | | | | | | | | | | | | | | | | And remove UI for default code style settings because it does not affect anything when ClangFormat plugin is enabled. Change-Id: Ie348b7d2691b09ea2b4868da987f2a27347ea0f3 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * Clang: Fix crash when removing diagnostic configNikolai Kosjar2018-11-083-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Create some Qt Console Application from the wizard 2. Open Tools > Options > C++ > Code Model 2.1 Click "Manage..." and create a custom configuration "custom" and finish with OK. 2.2 Set "custom" as diagnostic config. 3. Analyze > "Clang-Tidy and Clazy..." 3.1 Use "Custom Settings" 3.2 Click "Manage..." and remove "custom" ==> Crash The crash happened because the code model used an invalid diagnostic config id. The invalid id came from the settings, which were not correctly upated. Fixes: QTCREATORBUG-21273 Change-Id: I5242f7c92e121eec8558fa7923139bb3d759c676 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
| * Clang: Fix reading inconsistent settingsNikolai Kosjar2018-11-081-0/+6
| | | | | | | | | | | | | | | | | | | | The diagnostic id might not match any diagnostic configuration in the settings as Qt Creator prior version 4.8 could have written it inconsistently. We need to correct this case. Task-number: QTCREATORBUG-21273 Change-Id: Ic9e21f70bca94da6d9afb30f0b2bfd5024d16fdd Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | Merge remote-tracking branch 'origin/4.8'Eike Ziller2018-11-065-24/+39
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/debugger/debuggermainwindow.cpp src/plugins/qbsprojectmanager/qbsbuildstep.cpp src/plugins/winrt/winrtdevicefactory.cpp tests/unit/unittest/gtest-creator-printing.cpp tests/unit/unittest/gtest-creator-printing.h tests/unit/unittest/unittest.pro Change-Id: Ie9b80b87a8a4fa81baf72a2daa7919b21371c15e
| * CppLocatorFilter: Fix result sortingAndre Hartmann2018-11-022-13/+28
| | | | | | | | | | | | | | | | | | | | | | * Fix rating items with startsWith()/contains() higher * Rate matches in function parameter list lower Task-number: QTCREATORBUG-19377 Change-Id: I2ea4c3ba96cd086aef82627326fa0888f700850f Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
| * CompilationDatabase: Support both code modelsIvan Donchevskii2018-11-012-10/+0
| | | | | | | | | | | | | | | | | | Extract headers, defines and fileKind from flags in order to have complete project parts. Side-effect: better support for MSVC-specific flags. Change-Id: Iaa1413c91c96c3cf89ddbe76a7a1f0f46c5289c0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
| * Clang: Check that file kind matches the language versionIvan Donchevskii2018-11-011-0/+5
| | | | | | | | | | | | | | | | It was checked that pure C header and source files had proper language version but not another way around. Change-Id: I1eaf41f342731bdbe30ee73e81144334d0f15d19 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
| * Clang: Don't wrap Qt headers when generating compilation databaseIvan Donchevskii2018-10-301-0/+3
| | | | | | | | | | | | | | This trick is needed only for internal purposes. Change-Id: Ic10c0898519eed663d14c4b1665a0d6b0d47b4a4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
| * Fix missing translation contextsEike Ziller2018-10-251-1/+1
| | | | | | | | | | | | | | Change-Id: I4402157e7991ad0050333a34394b87ff3d6f4a1b Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>