summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools
Commit message (Collapse)AuthorAgeFilesLines
...
| * Clang: Go through CLANG-UPGRADE-CHECKIvan Donchevskii2018-10-251-0/+2
| | | | | | | | | | Change-Id: Iaaaea598d020a44bcdc60a8d06ee28a1f28386bb Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | CppTools: Change default of "Ignore precompiled headers" to falseOrgad Shaneh2018-11-012-2/+2
|/ | | | | | | | If the project has no PCH it has no effect, and if it does have PCH it is typically important to use it. Change-Id: I20ce2a0c5713253d2754d31e7b7dca51696b208b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppTools: Bump llvm.org docs link to version 7.0.0Alessandro Portale2018-10-241-1/+1
| | | | | | | | | Since we now ship clang 7 binaries, let's open the docs accordingly in the browser. Change-Id: Idfd8967fbbadfee87df6f7e721e1ee13ea15de87 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Clang: Fix naming conventions for *ModelManagerSupport* classesNikolai Kosjar2018-10-235-27/+27
| | | | | | | We use "Builtin" and "Clang" as prefixes, not suffixes. Change-Id: I6926aeb8f005176ef420c4421c257e3df61ee0b7 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: Fix build with clang 7.0Ivan Donchevskii2018-10-171-55/+104
| | | | | | | As an addition update the header with Clang-Tidy checks. Change-Id: Ib4a4d324e8cad95403a3e799e352205b05ed7475 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: Avoid starting backend jobs for inactive app and during VCS operationsNikolai Kosjar2018-10-164-0/+9
| | | | | | | | | | | | | | | | | | | | | ...to reduce file locking on Windows caused by clangbackend's parse/reparse jobs. Considering inactive application state should help for external VCS operations, e.g. on the command line. However, activating Qt Creator while such a VCS operation runs might still lead to undesired behavior, but this should be the less common case. VCS operations started from within Qt Creator should see less locking conflicts as we know when they start and finish. However, we just avoid starting new jobs - there might be still jobs running. Pending or new jobs will be started once Qt Creator is activated again and all VCS operations finished. Task-number: QTCREATORBUG-15449 Change-Id: I5f04c34f006e66162368efbdd58bd822a706f35e Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Remove hard-coded disabling of debug logsOrgad Shaneh2018-10-135-6/+6
| | | | | | | | | | | Instead, set the default level of all logs to QtWarningMsg. The call to setFilterRules overrides the user preferences in qtlogging.ini. Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Don't remove __cplusplusMarco Bubke2018-10-102-6/+26
| | | | | | | | | | | For the indexing we need all tool chain macros. Originally it was a fix because the C++ version of the project part and __cplusplus could be different but now they should be the same. They will be now removed in the compiler options builder. Change-Id: I7ae8721a29632473e76ecedb411a6c9001e5e199 Task-number: QTCREATORBUG-21265 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* CppTools: Inline ToolChainEvaluatorNikolai Kosjar2018-10-091-86/+40
| | | | | Change-Id: Ie5579820e4683a5e4d7d73034441d662e017b6a3 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* CppTools: Remove enum duplicationNikolai Kosjar2018-10-092-5/+4
| | | | | Change-Id: I2eb452780c21f8d30034bcfbb3266fc8daa10802 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* CppTools: Fix clang warnings about old-style castsChristian Kandeler2018-10-081-6/+8
| | | | | Change-Id: I947051dec996e92e4afe178e985374587337c4f0 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* CppTools/ProjectExplorer: Remove enum duplicationNikolai Kosjar2018-10-0811-108/+68
| | | | | | | | ... between CppTools::ProjectPart and ProjectExplorer::ToolChain. Change-Id: I8b448747e454adbed77547460383b8515462cc81 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Toolchains: Detect unspecified language versionNikolai Kosjar2018-10-087-52/+50
| | | | | | | | | | | | | | | | | | | | We checked the command line from the project manager for "-std=X" and friends to figure out the language version to use. However, if such a flag was not provided, we assumed the latest version we support. This could conflict with the actual version of the compiler and its predefined macros. Figure out the version by inspecting __cplusplus/__STDC_VERSION__ in the predefined macros of the toolchain. The MSVC compiler is an exception to this, as it does not seem to properly set the value - check for _MSVC_LANG if possible, otherwise simply assume some versions as before. While at it, add also support for C17/C18 and the upcoming C++2a. Task-number: QTCREATORBUG-20884 Task-number: QTCREATORBUG-21188 Change-Id: I464ffcd52d2120c0208275a050e82efda44fae1c Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* CompilerOptionsBuilder unit-testsIvan Donchevskii2018-10-042-28/+31
| | | | | | | Bonus: minor compiler options builder issues fixed. Change-Id: Ie25f8fad6729339de05f2bf9b614ceac873e2634 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* CppTools: Apply SkipBuiltIn also to toolchain definesOrgad Shaneh2018-09-252-11/+15
| | | | | | | | | | | | The only place where Yes is used is the compilation DB, which doesn't need these defines anyway. Also add -fPIC for Qt compatibility. This reduces the compile_commands.json file for Qt Creator from 180M to 33M. Change-Id: Idd3b363c3a143b1d79f97962c4ff9ee61d7767a4 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Merge remote-tracking branch 'origin/4.8'Orgad Shaneh2018-09-211-0/+3
|\ | | | | | | | | | | | | Conflicts: src/plugins/debugger/debuggermainwindow.cpp Change-Id: I07496916dd37b842d57ce5c49f99c079a9095a5f
| * Merge remote-tracking branch 'origin/4.7' into 4.8Eike Ziller2018-09-211-0/+3
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri Change-Id: Ia1d6035a335fd56069ec8d6d106d58124ee8798d
| | * CppTools: Fix crash on smart selection change with lambdaNikolai Kosjar2018-09-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | ...in case there is no lambda declarator provided, e.g.: []{} Fixes: QTCREATORBUG-20994 Change-Id: I6a77cffe4e585422f1ed0639cabc687d3d123f5d Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Clang: Fix the include paths order for libclangIvan Donchevskii2018-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang headers should always come first. After we removed '-isystem' from other paths it was still used for clang headers which put it in the end of list. This fix returns the paths their original order. Change-Id: I0a4ab450a5303e2536e60200f479cc19f6f55e99 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | | Clang/CppTools: Replace Q_DECL_NOEXCEPT with noexceptOrgad Shaneh2018-09-202-2/+2
| | | | | | | | | | | | | | | Change-Id: I105a5ed5e4a5c647f947a413ae8123d02bfdae3f Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | | Plugins: Add compilation database pluginIvan Donchevskii2018-09-194-0/+30
|/ / | | | | | | | | | | | | | | | | | | | | | | Introduce compilation database project support. Pass the arguments list for each file directly to ClangCodeModel via extraCodeModelFlags therefore introduce a dependency from the ClangCodeModel plugin. Change-Id: Iea5760d379de1ea246382dce56de0adf7ab5673d Task-number: QTCREATORBUG-21115 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | CppTools: Fix missing overrideEike Ziller2018-09-181-1/+1
| | | | | | | | | | Change-Id: I6ee424a844ce2657516258033764ef557a424830 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | Clang: Use built-in paths knowledge to better place clang include pathIvan Donchevskii2018-09-182-90/+84
| | | | | | | | | | | | | | | | Clang include folder should be a part of built-in includes and always come after user and system includes. Change-Id: I22961ea3bbb018f41b49f42c6ff7d22eb591ad01 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Clang: Skip built-in includes when exporting the compilation databaseIvan Donchevskii2018-09-172-1/+13
| | | | | | | | | | | | | | We don't want to have compiler-specific paths there. Change-Id: If26434ea3760d4f2ca4c25bbcf0340f4ea781072 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | ProjectExplorer: Rename compiler includes from System to BuiltInIvan Donchevskii2018-09-176-21/+29
| | | | | | | | | | | | | | | | | | System include are those used with -isystem keyword, built-in includes on the other hand come from compiler and always follow in the end of the include list (after system includes). Change-Id: I95c2fec36d2e5b43f014fe0a88d59c6769edfa1f Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Clang: Do not use -isystem in ClangCodeModelIvan Donchevskii2018-09-171-1/+3
| | | | | | | | | | | | | | | | | | Some other logic in the options builder is based on the -I usage and also we don't want to lock any files with ClangCodeModel. Change-Id: I4338abed26e91ebb0a561d449328ea0954fe44ea Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | ProjectExplorer: Remove HeaderPath::isFrameworkPathTobias Hunger2018-09-132-3/+3
| | | | | | | | | | | | | | None of the other types has a query function, so remove this one, too. Change-Id: I936d162e092c8f9361b0e3bb86676e68905d2f4b Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | ProjectExplorer: Consistently use HeaderPathsTobias Hunger2018-09-131-1/+1
| | | | | | | | | | | | | | Use HeaderPaths over QList<HeaderPath>. Change-Id: I8f78b0a44e0160f1a2e7a78d9db4d04fcaa22f82 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | ProjectExplorer: Remove HeaderPath::isValid and related codeTobias Hunger2018-09-132-3/+1
| | | | | | | | | | | | | | | | HeaderPath with an Null path are invalid, there is no need to have a special type for that. Change-Id: Ied102fbe523a8cf17e8b385ee89b099517a6d598 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | ProjectExplorer: Rename IncludePathType to HeaderPathTypeTobias Hunger2018-09-139-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | It is the type used by the HeaderPath class, so reflect that in the name. I also considered to rename HeaderPath to IncludePath, but that name is reflected in a lot of users, which would also need to be adjusted for consistency. That would blow up the patch size for little value IMHO. Change-Id: I51421dbd3ab8b2874dc32fc82dc394c9b93ce5e9 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Clang: Add refactoring project updaterMarco Bubke2018-09-123-2/+45
| | | | | | | | | | | | | | | | The project parts are now first used by the pch manager and then notified by the pch manager to the refactoring plugin. Change-Id: I88074d8891cd0de9721497bbafee0deffc0b6339 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | Clang: Use clang-format for indentationIvan Donchevskii2018-09-124-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the new experimental plugin based on LibFormat. It replaces the default indenter for CppEditorDocument and applies clang-format after the CR or the set of 'electric' characters. Uses the global .clang-format kept in QtC settings or the one for current project. Both can be configured. For indentation some style modifications and code manipulations are done to prevent line shrinking when it's not expected. Manual indentation uses unmodified style from .clang-format file. Change-Id: I6279b805e418e1804b553efa615f5c843f395a58 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | CppToolsPlugin: Simplify setup codehjk2018-09-101-2/+1
| | | | | | | | | | Change-Id: I4d738638aa363f66b3bbfd44f866eb8fa48fa226 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Add system include path to HeaderPath and merge ProjectPartHeaderPathMarco Bubke2018-09-1025-213/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | System include paths are appended after other includes by the compiler. So we should set them as system includes and not as normal includes. Otherwise we change the include order. Headers in system include paths are not cluttering the screen with unwanted warning and by the way improve performance too. ProjectPartHeaderPath was a dopperganger of HeaderPath, so we merged them. Change-Id: I7c394b4098b697de79761499ffcd5913cc02d652 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | CppTools: Do not auto-trigger completion after '{' and '(' in the new lineIvan Donchevskii2018-09-031-1/+4
| | | | | | | | | | | | | | | | | | | | There's no token before the first symbol in the line. With no information it's better to avoid triggering automatic completion after the first token. Change-Id: I9d3aca3bf72485c6eca6e03d9b8691abf0492bcc Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Clang: Fix completion after '{'Ivan Donchevskii2018-08-301-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up fix for 8d0391a4f9. Do not complete after '{' coming not after an identifier. Take constructor completions only for '{' and function completions only for '('. Filter constructor completions by class/struct type. Task-number: QTCREATORBUG-21004 Change-Id: I7ae2d6bee23cf907648c42b93eb12742942833f6 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Clang: Do not add -undef to ClangCodeModel arguments with clang-clIvan Donchevskii2018-08-281-1/+3
| | | | | | | | | | | | | | | | Clang-cl behaves similar to MSVC and the parsing is more proper without -undef specified. Change-Id: Iee37fca3401000edb3e77e8a99dcb85ae6e70ab3 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Clang: Fix include paths orderIvan Donchevskii2018-08-272-7/+124
| | | | | | | | | | | | | | | | | | | | C++ include paths should come before Clang include folder. Therefore parse all options for include/c++/v1, include/c++/{version}, include/g++ and /usr/local/include. Task-number: QTCREATORBUG-20231 Change-Id: I22c41f07d241e1e564069bb192d4fe637ff05e87 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Clang: Fix excluded Clang path regular expressionIvan Donchevskii2018-08-241-1/+1
| | | | | | | | | | | | | | Cover cases like /usr/lib64/clang/6.0.0/include Change-Id: I015ea3535637376eeab6f737752ad13d33887190 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Add optional system include to compiler option builderMarco Bubke2018-08-142-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | System includes suppress warnings and prevent indexing of unwanted symbols. Using system includes for all includes outside of the project can be quite advantageous. The rootProjectDirectory() can be extended to be set in the project settings. An automatic generation could be possible but could create an unwanted path which includes files outside of the perceived project. Change-Id: Ib9d3158f14f41efe1f6657f962d5c4437bb324b2 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | Clang: Add button to generate compile_commands.jsonIvan Donchevskii2018-08-132-66/+76
| | | | | | | | | | Change-Id: Iaabdcfc8d1b3463c3f6e5ce47536f9c52556eac0 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Clang: Provide include directory only for libclangIvan Donchevskii2018-08-082-35/+2
| | | | | | | | | | | | | | | | | | Only libclang has issues with the include directory search therefore undefining include folders makes sense only for libclang options builder. Change-Id: Ie3f62f5f3a89503e6e0ab59e18889e92425c3abc Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-08-071-0/+1
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/debugger/debuggerruncontrol.cpp Change-Id: I72882df605bc3fc8a8d20118fd4e49207ac92664
| * TextEditor: fix crash while request follow symbol and typing on macDavid Schulz2018-08-061-0/+1
| | | | | | | | | | | | | | | | Use a qobject_cast to prevent accessing a not available function. Task-number: QTCREATORBUG-20910 Change-Id: If2aa6b7b120379681e9590db80904c45a6d9bd55 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Utils: move code model icons to utilsDavid Schulz2018-08-061-1/+1
| | | | | | | | | | | | | | In preperation for the language server protocol support. Change-Id: Iee4ccd53a86d9afdb357972ea62b75ace2edcb1d Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | Clang: Move clang paths helper functions to Core pluginIvan Donchevskii2018-08-062-37/+10
| | | | | | | | | | | | | | | | | | | | These functions require core plugin so they can't go to utils library. At the same time to use them in ProjectExplorer plugin there are not too many choices where to put them without introducing new dependencies. Change-Id: I3cccccffaae8ac4bbce924fd809b5423da5dc503 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Prefer using 'override' instead of 'virtual'Alessandro Portale2018-07-117-59/+59
| | | | | | | | | | | | | | | | warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override] Change-Id: I6dac7a62b627fa1353b4455e1af92f869c2571cc Reviewed-by: Marco Benelli <marco.benelli@qt.io>
* | Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-07-054-30/+44
|\ \ | |/ | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri Change-Id: I29916313f12e25f3942ac926f8e4d4490074978e
| * CppTools: Fix getting locator filters from the object poolIvan Donchevskii2018-06-283-4/+43
| | | | | | | | | | | | | | | | | | They are no longer inside the global object pool. Get them from CppModelManager instead. Task-number: QTCREATORBUG-20678 Change-Id: Ifb3221a812295e1dcfe8b59ea693a4b350cbcc2e Reviewed-by: David Schulz <david.schulz@qt.io>
| * Clang: Avoid using -isystem include pathsNikolai Kosjar2018-06-271-26/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...as this leads to file locking issues on Windows and pointless diagnostics we currently ignore when opening files from -isystem include paths. The usage of -isystem suppressed warnings from system headers and resulted in a performance boost. Nowadays we can preserve this performance optimization by making use of the new CXTranslationUnit_IgnoreWarningsFromIncludedFiles. This flag helps us also to suppress diagnostics from clang tidy checks, which reported diagnostics even for -isystem headers. Change-Id: I33e1f7169e2ff9f17c811565a5324b9da4740701 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>