summaryrefslogtreecommitdiff
path: root/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Clang: fix clang static analyzer on WindowsIvan Donchevskii2017-09-071-5/+25
| | | | | | | | | | 1) mingw kit + qmake: do not add target includes not to override clang paths (for intrinsics and more) 2) msvc kit + qbs: remove target option from clang-cl arguments Change-Id: Ifb494ee61ae2d39e957cff31dbd647c66910be17 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangStaticAnalyzer: Don't show 'stopped by user' if it wasn'thjk2017-08-111-3/+5
| | | | | | Task-number: QTCREATORBUG-18581 Change-Id: Ib5d2aded5da14e44f3186a2ed67f119764d6d58d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangStaticAnalyzer: Don't get stuck if project is not buildablehjk2017-07-181-0/+1
| | | | | | Task-number: QTCREATORBUG-18495 Change-Id: I6621ceebd05be2fabcdcd3061e41e4674e5fbb26 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangStaticAnalyzer: Remove a few + QLatinChar('\n')hjk2017-07-181-17/+13
| | | | | | | It's implicit in appendMessage nowadays. Change-Id: I4f1bdde4d4127579d4b26cd275def59c65f18f2f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangStaticAnalyzer: Compile fix due to unsubmitted dependencyhjk2017-07-141-1/+1
| | | | | | | This patch needs to be reverted later. Change-Id: Ia120e225ec1086eca786f668999a48e5ee19ec7e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangStaticAnalyzer: Fix rampdownhjk2017-07-141-7/+8
| | | | | | | Stop button wasn't doing anything. Change-Id: I84f3d5dccdbdd5a7a800ecc86c3938b01eaa0550 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ProjectExplorer: Move re-runnable decision to RunWorkershjk2017-07-101-1/+1
| | | | | | | | | | | | A RunControl is re-runnable if all its workers are, a RunWorker is re-runnable if it's Stopped and unless it says otherwise. Also ensure SimpleTargetRunner only reportStop() once per run and make process error message re-usable. Change-Id: I73f5fb724d3026ceb81d5e32a3a71b4814b2bca9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Remove virtual RunControl start/stop trampolinhjk2017-06-301-1/+1
| | | | | | | Not needed anymore, effectively replaced by RunWorker start/stop. Change-Id: I7483c841cdd4e05c9e1f7636a27b20ece37947c2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangStaticAnalyzer: Adapt to new simpler RunControl creationhjk2017-06-201-6/+3
| | | | | Change-Id: Ib088828a9695938afb83bcdd2d5fd4124dd602a8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ProjectExplorer: Split Target and ToolRunners into smaller taskshjk2017-05-151-2/+3
| | | | | | | | This increases re-usability of activities like 'port gathering', and makes their use less dependent on actual device implementations. Change-Id: I017cb74874f2b38c487ba2d03906a675d5618647 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangStaticAnalyzer: Move closer to new target/tool splithjk2017-05-081-46/+78
| | | | | | | The ClangStaticAnalyzer is a tool. Change-Id: I1462997a99e49486b47accb302d3f5b7b0b672b6 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ProjectExplorer: Add a RunControl::supportsReRunning setterhjk2017-04-071-0/+1
| | | | | | | | Removes one reason to derive from base RunControls (specifically ValgrindRunControl). Change-Id: I81e32a49ef30e79ee7e7b53a54021eaaba43453a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Run RunControl::{start,stop} always asynchronouslyhjk2017-03-241-2/+1
| | | | | | | | | | | | | | | | This introduces a mini-state-"machine" to handle RunControl states Intialized->[Starting->Running->Stopping->Stopped->]*->Finished. Needing time between trying to start and getting feedback is nowadays the normal setup for all remote targets as well as for most local tools. Making that the default for all runs simplifies the code and provides an opportunity to (a) fix some currently wrong reports of "stopped immediately" and (b) to remove target-specific (WinRT) or tool-specific (Valgrind, GammaRay) state members doing essentially the same. Change-Id: I7f52fee41144188ee8389e922fdc265f8c0a6459 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ClangStaticAnalyzer: Remove -fPIC workaroundNikolai Kosjar2017-03-161-3/+0
| | | | | | | | | | | | The option -fPIC predefines the macros __pic__ and __PIC__ and it was added just to have these macros and thus avoid a parse error somewhere in qglobal.h. Nowadays we get these macros from the project/toolchain, so remove this workaround. Change-Id: Ib6106cf217f7d8a08da6f7dde435bcadd04b6ba8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectPart: Add callGroupIdTobias Hunger2017-03-091-12/+7
| | | | | | | | Do not rely on the projectfile being unique anymore. Change-Id: I52e63b3ac8aeca43ef70af1d59d1d8612bd3540e Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ProjectPart: Allow for line/column information in project fileTobias Hunger2017-03-091-1/+6
| | | | | | | | | | Keep this information separate so that plugins using the information do not need to start parsing the project file. Change-Id: Ibecf431de1b12bbe820c6f8f9c986cffeb4972d2 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Revert "CppTools: Do not put configuration document into global snapshot and ↵Nikolai Kosjar2017-03-071-0/+2
| | | | | | | | | | working copy" This reverts commit 05942b63f8bad6d6787fea10c31f10458cdccd06 because it breaks refactoring, e.g. Q_PROPERTY generators. Change-Id: I9a14b912ba72663f08ea99e7e066d824b18da4b0 Reviewed-by: David Schulz <david.schulz@qt.io>
* ProjectExplorer: Unify RunControl setup/teardownTobias Hunger2017-03-011-15/+7
| | | | | | | | | | | | | | Provide protected methods in RunControl to handle the notification of when the RunControl starts and stops. Use these helpers to move the isRunning() method into the RunConfiguration itself instead of reimplementing it everywhere. Change-Id: Ia8de42f7a6a14a049870d4e7fcb9af6756c2caa4 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* CppTools: Distinguish between ProjectFile::{unclassified,unsupported}Nikolai Kosjar2017-02-021-0/+1
| | | | | | | | | There was no way to determine whether ProjectFile::classify() was run or not. Now, ProjectFile::classify() returns ProjectFile::Unsupported instead of ProjectFile::Unclassified. Change-Id: I660d0e42044bdefcac38058c6f4a3425983a6d93 Reviewed-by: David Schulz <david.schulz@qt.io>
* ProjectExplorer: Added support for registering custom languagesFilippo Cucchetto2017-01-231-2/+2
| | | | | Change-Id: I728a2ed1ef7d9f44d7c2b59d27d6e23444cd3bb5 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Utils: Introduce a TemporaryDirectory and TemporaryFile classTobias Hunger2017-01-201-2/+2
| | | | | | | | Both wrap the corresponding Qt class, but make sure all temporary files or directories are created inside a "master temporary directory". Change-Id: I55461be507c828c965224c02863ea5ed9bbf9498 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* CppTools: Clean up ProjectInfoNikolai Kosjar2016-12-131-2/+2
| | | | | Change-Id: I5d0db45d9fdb624bb6cc55d7f04061d553f13bce Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Do not put configuration document into global snapshot and working ↵Nikolai Kosjar2016-12-081-2/+0
| | | | | | | | | | copy These are remnants of the time when we had only one snapshot. Change-Id: I6ff4db645d1065a0ef195834890e0774e2e2c60e Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Clang: Take precompiled headers into account when parsing source filesDenis Klychkov2016-11-161-3/+14
| | | | | | Task-number: QTCREATORBUG-15590 Change-Id: Icbfce4ffd6e9f9802641d35d898fa1dc1c4c18ee Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang*: Workaround parsing mingw's <type_traits> with clang 3.9Nikolai Kosjar2016-10-181-0/+1
| | | | | | | | | | | | ...for -std=gnu++0x. Define the unknown identifier/type "__float128" so at least the headers can be parsed successfully. Of course this does not help for parsing client code referencing that identifier, but this should be the less common case. Task-number: QTCREATORBUG-17126 Change-Id: Id321311713029d8aa77e068b02361d86debfada6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Clang: Avoid running into gcc/mingw intrinsicsNikolai Kosjar2016-10-181-8/+1
| | | | | | | | | | | | Same as for the Clang Static Analyzer, so move the implementation into the base class and use it. This has gone unnoticed so far because it looks like that the error diagnostic from the bug report can be extracted with libclang (as shown in the info bar), but is not printed from libclang or clang.exe itself. Change-Id: I5b714ba374c5fdefe234faf012a3515e96c9a08c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Clang: Fix parsing MSVC's crtdefs.h for 64 BitNikolai Kosjar2016-10-181-22/+16
| | | | | | | | | | | | | ...by specifying the word width, as for the Clang Static Analyzer. This has gone unnoticed so far because it looks like that the error diagnostic from the bug report can be extracted with libclang (as shown in the info bar), but is not printed from libclang or clang.exe itself. Task-number: QTCREATORBUG-17130 Change-Id: Ia7a5ee3825c7211cdf80c2166a9eb454ce48cac1 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Clang: Use compiler specific undefine optionNikolai Kosjar2016-10-181-0/+7
| | | | | | | | | | | | | libclang generated: warning: /U__cpp_aggregate_nsdmi: 'linker' input unused [-Wunused-command-line-argument] warning: /U__cpp_alias_templates: 'linker' input unused [-Wunused-command-line-argument] ... It needs -U. Change-Id: Ibbd2f97e6f806215e3008803f57608b9b6b4c641 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Always pass in header paths as native pathsNikolai Kosjar2016-10-171-1/+1
| | | | | Change-Id: I473c737107c14a4bc2c78b7c697eef02eb4bacff Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangStaticAnalyzer: Remove new line character from define valueNikolai Kosjar2016-10-171-1/+1
| | | | | Change-Id: I3949ba372c490d39b4277825f5194a8d36ee26d2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangStaticAnalyzer: Use native paths consistentlyNikolai Kosjar2016-10-131-1/+1
| | | | | | | ...when passing on arguments to the clang executable. Change-Id: I78d523289abadee85d8987e54fb962220b1e62a8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Simplify Utils::sort calls that sort by memberOrgad Shaneh2016-08-091-3/+1
| | | | | Change-Id: I0937e98014f223f42fbf1c6b2bd94fb109bc8870 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/4.1'Orgad Shaneh2016-07-291-3/+20
|\ | | | | | | Change-Id: Ie96fa53a88bcd06fa688a579c1d84aaf6f5e905f
| * ClangStaticAnalyzer: Do not try to determine version of clang-cl.exeNikolai Kosjar2016-07-271-3/+20
| | | | | | | | | | | | | | It does not understand "--version". Use clang.exe for the version check. Change-Id: I64a46e8e2e5be47ad6f13c9c5497264e1128a22a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/4.1'Orgad Shaneh2016-07-221-0/+22
|\ \ | |/ | | | | Change-Id: Ia90424d479936a898705c433e5810c77ae088b2c
| * ClangStaticAnalyzer: Warn about unsupported versionNikolai Kosjar2016-07-191-0/+22
| | | | | | | | | | | | Change-Id: I4d8471b7d49c8f295d37add5a0c5b8a698e0f9d4 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/4.1'Eike Ziller2016-07-151-0/+16
|\ \ | |/ | | | | Change-Id: I041b949aff8bee481a572ba6f7e2ef72b9010923
| * ClangStaticAnalyzer: Fix analyzing qbs projects on macOSNikolai Kosjar2016-07-131-0/+16
| | | | | | | | | | | | | | | | | | The system clang on macOS is aware of the header paths, but not our shipped clang. Task-number: QTCREATORBUG-15869 Change-Id: Iabb56d9443808be2822a21b48bb111a6a8a8c604 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Kits: Save several ToolChains per kitTobias Hunger2016-07-141-2/+2
|/ | | | | | | | | | BREAKS BACKWARD COMPATIBILITY OF TOOLCHAIN SETTINGS! * Convert old ToolChainKitInformation to new version * Store several toolchains in one kit (one per language) Change-Id: Ia59a2ad067c57971ec34ce9b2e43758344443755 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
* ClangStaticAnalyzer: Stop passing on toolchain defines for qmake/msvc caseNikolai Kosjar2016-07-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-produce with: 1) Open qt-essential-includes.pro and configure it with a Qt 5.7.0 MSVC2013 64 Bit Kit. 2) Run the analyzer. Errors during analyzing occur in winnt.h [1]. This is somehow related to /D__int32=long that we pass on. Removing it helps. It looks like there is no reason anymore to pass on the toolchain defines with clang-3.8 at all. Our unit test projects can be parsed by the analyzer without them. Tested with the following kits: Qt 5.6.0 (mingw39_32) Qt 5.6.0 (msvc2013) Qt 5.6.0 (msvc2013_64) Qt 5.6.0 (msvc2015) Qt 5.6.0 (msvc2015_64) Qt 5.7.0 (mingw53_32) Qt 5.7.0 (msvc2013) Qt 5.7.0 (msvc2013_64) Qt 5.7.0 (msvc2015) Qt 5.7.0 (msvc2015_64) [1] In file included from D:\dev\creator\creator-4.1\src\plugins\clangstaticanalyzer\unit-tests\qt-essential-includes\main.cpp:2: In file included from D:/usr/qt-5.7.0-msvc2013_64/5.7/msvc2013_64/include/QtGui\QtGui:32: In file included from D:/usr/qt-5.7.0-msvc2013_64/5.7/msvc2013_64/include/QtGui/qopenglcontext.h:60: In file included from D:/usr/qt-5.7.0-msvc2013_64/5.7/msvc2013_64/include\QtGui/qopengl.h:49: In file included from D:/usr/qt-5.7.0-msvc2013_64/5.7/msvc2013_64/include\QtCore/qt_windows.h:61: In file included from C:\Program Files (x86)\Windows Kits\8.1\include\um\windows.h:164: In file included from C:\Program Files (x86)\Windows Kits\8.1\include\shared\windef.h:24: In file included from C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h:182: C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(3077,1) : error: functions that differ only in their return type cannot be overloaded __getcallerseflags ( ^ D:\dev\llvm\3.8\changingLibClang_install\bin\..\lib\clang\3.8.1\include\intrin.h(68,14) : note: previous declaration is here unsigned int __getcallerseflags(void); ~~~~~~~~ ^ 1 error generated. Change-Id: I2de8d0393a575f88dd59dfa71fbfb11f2debc158 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangStaticAnalyzer: Undefine clang version macros for MSVC KitsNikolai Kosjar2016-07-071-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes parsing of Qt 5.7.0 headers with a MSVC Kit. Re-produce with: 1) Open qt-essential-includes.pro or the *.qbs and configure it with a Qt 5.7.0 MSVC2013 Kit. 2) Run the analyzer. Errors during analyzing occur in qtypetraits.h [1] because * Q_COMPILER_UNICODE_STRINGS is defined in qcompilerdetection.h because... * Q_CC_CLANG is defined because... * __clang* is defined. Undefine the __clang* macros so the "right" compiler will be detected. [1] In file included from D:\dev\creator\creator-4.1\src\plugins\clangstaticanalyzer\unit-tests\qt-essential-includes\main.cpp:1: In file included from D:/usr/qt-5.7.0-msvc2013_32/5.7/msvc2013/include/QtCore\QtCore:4: In file included from D:/usr/qt-5.7.0-msvc2013_32/5.7/msvc2013/include/QtCore/qabstractanimation.h:43: In file included from D:/usr/qt-5.7.0-msvc2013_32/5.7/msvc2013/include\QtCore/qobject.h:46: In file included from D:/usr/qt-5.7.0-msvc2013_32/5.7/msvc2013/include\QtCore/qobjectdefs.h:48: In file included from D:/usr/qt-5.7.0-msvc2013_32/5.7/msvc2013/include\QtCore/qnamespace.h:43: In file included from D:/usr/qt-5.7.0-msvc2013_32/5.7/msvc2013/include\QtCore/qglobal.h:1139: In file included from D:/usr/qt-5.7.0-msvc2013_32/5.7/msvc2013/include\QtCore/qtypeinfo.h:41: D:/usr/qt-5.7.0-msvc2013_32/5.7/msvc2013/include\QtCore/qtypetraits.h(251,19) : error: redefinition of 'QtPrivate::is_integral<unsigned short>' template<> struct is_integral<char16_t> : true_type { }; ^~~~~~~~~~~~~~~~~~~~~ D:/usr/qt-5.7.0-msvc2013_32/5.7/msvc2013/include\QtCore/qtypetraits.h(235,19) : note: previous definition is here template<> struct is_integral<unsigned short> : true_type { }; Change-Id: I10da2a1daa6f5ea2828f7ea4bcf594050a585b61 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangStaticAnalyzer: Improve debug outputNikolai Kosjar2016-07-051-1/+2
| | | | | | | | * Normalize line endings from process output * Do not print extra quotes Change-Id: I39e055bed09c4fe52878d63fc443130d70be95cb Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Debugger: Dissolve AnalyzerUtils::logToIssuesPane()hjk2016-05-311-7/+10
| | | | | | | | | If the Error + popup combo is generic it should live in TaskHub. If it is not, end user code should decide when to popup. Not an intermediate level. Change-Id: I195ba8c17c5cc192ff9762ed6f45629143bcbb35 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangStaticAnalyzer: Directly construct RunControlhjk2016-05-311-1/+1
| | | | | | | | This only runs directly locally, so there's currently no need to go through the AnalyzerManager indirection. Change-Id: Ie241b362b870e8ea0be221c501420573596e34f2 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Analyzer: Move toolbar icon specification down to individual RunControlshjk2016-05-311-1/+3
| | | | | | | | Giving individual RunControls the freedom back to decide what they want, even if they currrently decide to use the same one. Change-Id: Ia2acf4b9d32d23c486339b2488611038672aba25 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ClangStaticAnalyzer: Really cancel on user requestOrgad Shaneh2016-05-171-1/+1
| | | | | | | | | | Currently when clicking the X icon next to Clang Static Analyzer progress bar, clang is no longer executed, but the mouse cursor remains busy, and trying to quit Qt Creator warns about running analyzer. Change-Id: I1dc8b92fdaf03cd25a2ad40d24d0f76907dd791c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangStaticAnalyzer: Set run control display nameUlf Hermann2016-04-211-0/+1
| | | | | Change-Id: I90ca5c9374a1c82d9a5113c06c2e5c76719d45c7 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangStaticAnalyzer: Determine target ABI from toolchainUlf Hermann2016-04-211-1/+1
| | | | | | | | As we don't want to run the application, we should check how it was built in order to know the word width. Change-Id: I3bcd86a4653a049d660a9f23f8faf823f3ed52a0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: Enable exceptions explicitlyNikolai Kosjar2016-04-131-3/+10
| | | | | | | | | | | | | For some reason, clang 3.8.0 on Windows does not enable exceptions anymore, which leads to parse errors in MSVC headers (reported upstream [1]). With this change, we can finally parse main/mainwindow.cpp of a Qt Widgets Application for a MSVC2015 Kit and libclang 3.8.0 without any error. [1] https://llvm.org/bugs/show_bug.cgi?id=27324 Change-Id: I532ad4852a06318baf083d363378bc577b3c4309 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Clang: Undefine language features as fix for MSVC2015/clang-3.8.0Nikolai Kosjar2016-04-121-53/+12
| | | | | | | | | | This applies the following change for the clang code model, too. commit d13d1795241602ca0cf150b216b282cfb15e406d Clang Static Analyzer: Workaround analyzing MSVC2015 projects with clang 3.8.0 II Change-Id: Ia229d7e8b24c2e1c0a83d9a53c623ea1f79c4a06 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>