Commit Graph

43 Commits

Author SHA1 Message Date
hjk
e3b1106afa Compile fix with recent Qt dev
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.

Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-29 08:54:18 +00:00
Nikolai Kosjar
bf98bea4ad ClangTools: Sanitize parameter order
The path to the serialized diagnostics log is the main parameter, so put
it first.

Change-Id: I8865aad302b0e5d3008dab606ab774167cebda3c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-07-26 09:54:13 +00:00
Nikolai Kosjar
f240a9a947 ClangTools: Add using for QList<Diagnostics>
Change-Id: Ie7978fc33386d083b786ad75b3b6700125b11fec
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-25 12:18:49 +00:00
Tim Jenssen
333b33edbe Merge remote-tracking branch 'origin/4.10'
Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
2019-07-12 15:53:56 +02:00
Nikolai Kosjar
b6346369eb ClangTools: Fix showing diagnostics outside the project root dir
Accept diagnostics from files that are known to the project
(Project::files()) instead of checking whether they are below the
project root directory (Project::projectDirectory()).

Fixes: QTCREATORBUG-22213
Change-Id: I2f96374d6de3f53b1bd42be875dfe44b25a55fb1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-10 07:56:57 +00:00
Eike Ziller
10098b2508 Merge remote-tracking branch 'origin/4.10'
Conflicts:
	CMakeLists.txt
	tests/unit/unittest/unittest.pro

Change-Id: I64296ad31502d9b35012da129a28e9277e9fcf8e
2019-06-28 12:50:03 +02:00
Nikolai Kosjar
83bf414c85 ClangTools: Hint to "Build the project before starting" option
...if the analysis ends with errors.

Task-number: QTCREATORBUG-22382
Change-Id: I59f99947e80f7f4d0e2cac4df2e00f68e385ee01
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-06-25 08:16:47 +00:00
hjk
309c644466 ClangTool: Sanitize style
The string is passed further on as char * anyway, no need for
templates here.

Change-Id: I9305225f96111c0e9228d372e1231846099a9ecc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-06-12 06:55:05 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Orgad Shaneh
6fc532f812 Merge remote-tracking branch 'origin/4.9'
Change-Id: If4e8f52fc94c4e5fd9ec69c9000436d4ded913ff
2019-02-15 13:42:44 +02:00
Nikolai Kosjar
d6a6d356bb ClangTools: Add errors as errors to issues pane
Fixes: QTCREATORBUG-19047
Change-Id: I4aca248d1ccb625fef77632bf35b554d7441e5cc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-11 15:05:11 +00:00
Nikolai Kosjar
cc81284db6 ClangTools: Clear entries from issues pane when starting
Change-Id: I3e192c539236b80bf99431fa9d0b0232213a5372
Fixes: QTCREATORBUG-19049
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-11 15:04:48 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Nikolai Kosjar
b9d3055e72 Clang: Allow to forward warnings flags from build system
Change-Id: I47ebb1ce4f3b5544408eb1d0f891ed5090394282
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-05 11:36:55 +00:00
Nikolai Kosjar
46fc8c4144 ClangTools: Show also diagnostics from project's header files
Fixes: QTCREATORBUG-21452
Change-Id: I73c85224e142f4f1d08c9ada75fe8359ebf0f984
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-25 14:32:01 +00:00
Ivan Donchevskii
0679c2ff25 Clang: Never use toolchain defines
The known cases provide enough flags not to require
toolchain defines.

Change-Id: Ia7e08a90eca6ea9474db40683ac1e63236f8643d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-16 12:18:55 +00:00
Nikolai Kosjar
f6b8302efd Clang: Stop forwarding toolchain macros
...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>
2018-12-10 10:25:22 +00:00
Nikolai Kosjar
c7c800a73e CppTools: Split CppTools::UseBuiltin in two options
...for clarity.

No behavior change.

Change-Id: Id0334bc79b97a8ff53b37089e337530c9a01b1d4
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-12-04 14:57:20 +00:00
Nikolai Kosjar
273157c2a1 Clang: Unify CompilerOptionsBuilder options
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>
2018-12-03 15:19:03 +00:00
Nikolai Kosjar
0c38e3aea7 Clang: Clean up CompilerOptionsBuilder
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>
2018-12-03 12:58:31 +00:00
Alessandro Portale
c4b07bf730 ClangTools: Modernize
modernize-use-nullptr
modernize-use-override
modernize-use-equals-default

Change-Id: I14a840c6f2972f57763cdfd4bb4483df1ec261d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-11-08 11:40:57 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
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>
2018-10-13 16:36:58 +00:00
Marco Bubke
77b5907c57 Don't remove __cplusplus
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>
2018-10-10 12:25:30 +00:00
Ivan Donchevskii
eeece5b5ad Clang: Skip built-in includes when exporting the compilation database
We don't want to have compiler-specific paths there.

Change-Id: If26434ea3760d4f2ca4c25bbcf0340f4ea781072
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-09-17 13:13:16 +00:00
Ivan Donchevskii
1b4f5c0670 Clang: Fix include paths order
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>
2018-08-27 11:35:02 +00:00
hjk
263cf4c608 ProjectExplorer: Remove RunWorker::setDisplayName
It has been an obsolete alias for setId for a while and downstream
uses have been adapted.

Change-Id: I467370aa67054599c7771e8275d28e62ddc461fa
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-21 08:02:22 +00:00
Ivan Donchevskii
81d5d99db8 ClangTools: Do not spam the warning pane with long messages
The user does not usually need the whole command line.

Task-number: QTCREATORBUG-20707
Change-Id: I30cd395cd85eb0a3dd19b9d5f1b34a1c7a4b95a5
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-08-20 09:50:21 +00:00
Orgad Shaneh
9e27c865f5 Clang: Fix usage of QString args
Change-Id: I49f1a79b9dfd27d896b296d65d375a05879bdc8f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-18 18:04:21 +00:00
Ivan Donchevskii
62e776aa8e Clang: Provide include directory only for libclang
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>
2018-08-08 14:07:13 +00:00
Ivan Donchevskii
344cbb3a1b Clang: Move clang paths helper functions to Core plugin
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>
2018-08-06 12:38:52 +00:00
Robert Loehning
aaec887b15 ClangTools: Remove HTML from translated string
Change-Id: I74ab16ebebd00354a0821853f5a061e97b0c4f8b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-07-31 10:39:45 +00:00
Robert Loehning
0471ea1f94 ClangTools: Use proper argument for toolName
Change-Id: I9f258e97b5ef1bfd06909d2f12b644c145501a54
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-07-25 08:08:48 +00:00
Ivan Donchevskii
75cda95039 Clang: Add option 'Build before analysis' to project settings
Diagnostic configuration Id was already there but
not the checkbox whether to build project or not.

Change-Id: Icb5fc15bda5eed5e375cd90df1a96060b30bf57e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-06-15 12:14:44 +00:00
Nikolai Kosjar
bb6c02a443 ClangTools: Remove dead code
Change-Id: I5db111402902e81099489dc5ab4b0b929c574969
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-06-05 10:36:21 +00:00
Nikolai Kosjar
b81e5cb3b2 ClangTools: Remove temporary dirs
...when a new run is triggered instead of on Qt Creator shutdown.

There is no reason to keep them around for longer than needed.

Change-Id: Ida7698843cc2f8822ffd662679cf5da2c4ece05c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-06-05 10:36:03 +00:00
Ivan Donchevskii
87678e9a07 ClangTools: Remove huge "log files" after we've read them
Serialized diagnostics consume quite a lot of space.
Remove these files after they are read by QtC.

Change-Id: I4b257e44ee182484726ebd808069198443992016
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-06-05 09:00:08 +00:00
Ivan Donchevskii
3737b6a124 CppTools: Split diagnostic settings and selection
Now selection is only consists of combobox and
a "Manage" button to diagnostic configurations.
Diagnostic configurations are moved to the modal dialog
which is shown by clicking the mentioned "Manage" button.

Change-Id: I607fb923c97e8730448548708f3aaf32ce1983c8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-05-14 07:02:53 +00:00
Nikolai Kosjar
23df884f4a ClangTools: Remove clang static analyzer
...since it's superseded by the tidy integration.

Change-Id: Idafa5e1fb5129b1af8e42231a664684d4b90821f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-05-11 12:17:55 +00:00
Nikolai Kosjar
1bc605d050 ClangTools: Prompt for files to analyze
If the run button is clicked, the user is prompted to select the files
for analysis.

Change-Id: I21e4ee6b7c14392a8c1a901ac7aa1c9c16e30f0d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-05-11 10:48:53 +00:00
Ivan Donchevskii
97fc02b247 ClangTools: Add settings for build project dependency
All Clang tools get support for running project build
before themselves or skipping that step.
Before this change static analyzer always ran it and
ClangTidy+Clazy tool always skipped.

Change-Id: Idb9fbc27f0589472abb0f9d207857eb79c0079fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-05-08 11:29:19 +00:00
Ivan Donchevskii
52ac74b61c ClangTools: Remove clang executable settings
We use custom clang executable and it does not make
sense anymore to give a choice of changing it.

Change-Id: Icf86042ac3fcd08c320ef2bbdaabef1102b023b5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-05-04 09:58:37 +00:00
Ivan Donchevskii
219e23332e ClangTools: Add tool that runs clang-tidy and clazy
... over the whole project.
Generate and read serialized files to get diagnostics.

Change-Id: Iafc25fc70443107a040a995efc038aed35102bbf
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-26 13:02:19 +00:00
Ivan Donchevskii
e9c462391e ClangTools: Split generic part from static analyzer tool
To reuse it for other clang-based tools.

Change-Id: I6c0d8e9eee543fa08faf3bf93c9fac33e43c6820
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-13 12:34:53 +00:00