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>
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>
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>
* Normalize line endings from process output
* Do not print extra quotes
Change-Id: I39e055bed09c4fe52878d63fc443130d70be95cb
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
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>
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>
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>
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>
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>
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>
This applies the following change for the clang code model, too.
commit d13d179524
Clang Static Analyzer: Workaround analyzing MSVC2015 projects with clang 3.8.0 II
Change-Id: Ia229d7e8b24c2e1c0a83d9a53c623ea1f79c4a06
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Infer the version from the _MSC_FULL_VER macro, so it cannot get out of sync
with that.
Adapt the analyzer to do the same.
Based on
commit daf08d8702
Clang Static Analyzer: Workaround analyzing MSVC2015 projects with clang 3.8.0
Change-Id: I9d34abdbe2c83fe271eadd8d051caad43aca6772
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
We will need the id in a follow-up change to match the corresponding project
part.
Change-Id: Id7686503f96fb238c9fa9857e7fde5cf94b0bcc7
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
As for the analyzer, this makes us independent of the default triple and will
most likely reduce the maintenance - e.g. the target implies certain internal
command line arguments, we will profit from added ones.
This fixes parsing of mingw headers with the clang code model.
Change-Id: I722b981125a80fac5f62a7af40a83ecdd7bbf811
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
clang 3.8.0 predefines language feature macros (__cpp_*), but clang 3.6.2 and
MSVC2015 do not. Plus, there is a mismatch between Q_COMPILER_CONSTEXPR and
Q_DECL_CONSTEXPR if those language feature macros are defined. The latter is
fixed for Qt 5.8.0 [1]. Together, this leads to the following error:
In file included from D:\work\testprojects\qt-widgets-app\mainwindow.cpp:1:
In file included from D:/work/testprojects/qt-widgets-app/mainwindow.h:4:
In file included from D:/usr/qt-5.6.0-msvc2015_32/5.6/msvc2015/include/QtWidgets\QMainWindow:1:
In file included from D:/usr/qt-5.6.0-msvc2015_32/5.6/msvc2015/include/QtWidgets/qmainwindow.h:37:
In file included from D:/usr/qt-5.6.0-msvc2015_32/5.6/msvc2015/include\QtWidgets/qwidget.h:41:
In file included from D:/usr/qt-5.6.0-msvc2015_32/5.6/msvc2015/include\QtGui/qpalette.h:38:
In file included from D:/usr/qt-5.6.0-msvc2015_32/5.6/msvc2015/include\QtGui/qcolor.h:40:
D:/usr/qt-5.6.0-msvc2015_32/5.6/msvc2015/include\QtGui/qrgba64.h(72,13) : error: constexpr function never produces a constant expression [-Winvalid-constexpr]
QRgba64 fromRgba64(quint64 c)
^
D:/usr/qt-5.6.0-msvc2015_32/5.6/msvc2015/include\QtGui/qrgba64.h(77,17) : note: non-constexpr constructor 'QRgba64' cannot be used in a constant expression
QRgba64 rgba64;
^
D:/usr/qt-5.6.0-msvc2015_32/5.6/msvc2015/include\QtGui/qrgba64.h(42,7) : note: declared here
class QRgba64 {
^
1 error generated.
[1] https://codereview.qt-project.org/#/c/149027
Task-number: QTCREATORBUG-15940
Change-Id: I54e22d15981e7ff83fff8184db616641429e2178
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Clang 3.8.0 does not detect the MSVC2015 build environment properly. Running
$ clang.exe -v -fsyntax-only empty.cpp
shows
-fms-compatibility-version=18 (=MSVC2013)
instead of the expected
-fms-compatibility-version=19 (=MSVC2015)
Workaround this by setting the version explicitly for MSVC2015 toolchains. This
fixes parse issues with char16_t and friends.
We do not explicitly check for the clang version since clang 3.6.2 is broken
for MSVC2015 anyway and we do not know whether clang 3.8.1 will come with a
fix.
Task-number: QTCREATORBUG-15940
Change-Id: Ibe61af25f6d74f134cc9f9681db5a4d19ac67417
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
The default target of clang.exe might be unfavorable since it depends on
e.g. the tool chain used to build clang.exe:
default target
clang build with msvc: i686-pc-windows-msvc
clang build with mingw: i686-pc-windows-gnu
The correct target is important since it not only has implications on
the built-in macros and include paths, but also on parsing options. For
example, the msvc target silently adds the following parsing options
-fms-extensions
-fms-compatibility
-fms-compatibility-version=17.00
-fdelayed-template-parsing
...as can be seen by the output of
$ clang.exe -### empty.cpp
Change-Id: Icd8aaf11016e59f37025cbf1c97da81511ff249b
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
If a run finished Application Output pane still handled the respective tab
as running.
Change-Id: I0bc7e1f61b68e700a875538bdd1c63c18bec8df3
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
On the user-visible side, only the 'Analyze' mode button disappears,
and instead a combobox to switch between different tools in appears
in the Debug mode toolbar.
Internally, that's quite some re-organzition: The centralized
'Analyze mode is busy' flag is gone, allowing us to run e.g.
ClangStaticAnalyzer and MemCheck in parallel.
Analyzer tools and debugger now share the same mechanism to
generate/load/save dock widgets.
Analyzer tools now create and handle their own start/stop button
when appropriate. In general, Analyzer tools can create/handle more
than one run control at a time.
Further consolidation is possible, e.g. RunControl state handling
could be merged into the base ProjectExplorer::RunControl to
avoid the still existing duplication in ~15 instances.
Change-Id: I91e5940ebc4211f98056d507cf2f7b5f8efe7f07
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This is the first mechanical step to execute on the 'shared pool of
debugger/analyzer views' idea.
Future steps would be providing infrastructure for the view pool,
making all analyzer/debugger views use the pool and then re-extract
a sensible base for a 'analyzer-and/or-debugger' tool plugin interface.
Change-Id: I1bb392e6dd3084fc56937956bee1d6fd9530335d
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
...at the end.
For cases where msvc parses/compiles fine but clang not, the issues pane was
not always shown in the end.
Task-number: QCE-62
Change-Id: Iab979b664e37dc7b35c2418566a7af74a4907829
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Remove unneeded function arguments, Qt 5 connects etc.
Change-Id: I95faf80e7b5ccc574e2457b841f7913bc2aa05d3
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
When moving the files within the merge commit, git for some reason does not recognize the files as moved, so we move them before actually doing the merge.
Change-Id: I5a8ba6b027734c8ff38a7f2a5dc51a30a0fc17a8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>