Commit Graph

20 Commits

Author SHA1 Message Date
Nikolai Kosjar
3afb348439 Clang: Add cmake project for tidy/clazy demo code
...as it's easier to generate a compile_commands.json with it as with
qmake.

Change-Id: I415b4d1d3d6d1d55c4d086c6dbbbca532c2c8669
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-07-26 09:54:25 +00:00
Nikolai Kosjar
6a74a24f8c Clang: Fix tidy demo file
Revert unintended addition.

Change-Id: I8ee78ee6e59f7fdc29d62df3e720c5c2dd706ada
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-26 14:29:21 +00:00
Ivan Donchevskii
efc39304a1 Clang: Move the majority of completion items sorting to ClangBackend
With this change ClangCodeModel only needs to sort completions by prefix.

Also some other optimization have become possible and are implemented here:
1. Getting completions after '{' for constructor overloads by replacing
   it with '(' inside usaved file.
2. Checking for all overloads requires only previous item check because
   all Class completions are already sorted to go before all CXXConstructor
   completions. Since they are not mixed no extra search is required.

Change-Id: Ie0187ad96a20857a63c1d71ddec74606b803f572
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-10-02 12:29:23 +00:00
Ivan Donchevskii
ce032552c0 Clang: Support old-style SIGNAL/SLOT macro
Color types and enable Ctrl+click for the functions
and types inside SIGNAL/SLOT macros.

Change-Id: Ic1c0b7372fe9a73c5607b1973d75a6656c75ef0e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-05-03 13:34:21 +00:00
Nikolai Kosjar
e5610c6ae2 Clang: Clean up qobjectdefs.h
* Remove unneeded #include that might lead to false diagnostics
* Fix typo

Change-Id: I38a3bbe07dbcb33f004c7b7a2a4ca4a90fb77350
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-11 07:18:21 +00:00
Nikolai Kosjar
bfdcbf861f Clang: Fix parse errors in clazy/tidy demo project
...otherwise not all intended diagnostics can be demonstrated.

Change-Id: I2f69862cc6c8a2e58059d9075ad6fd7c7e72b4a5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 08:08:39 +00:00
Ivan Donchevskii
34fec1cad2 Clang: Make Q_PROPERTY replacement simpler
The infrastructure around Q_PROPERTY extraction
allows to make it static assert and still find
it's parent.
This way makes it easier for Clang to parse
and does not provide unexisting functions for class.

Change-Id: I1c40550c72d214c2448169094a46c6f793132f23
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-23 08:40:33 +00:00
Ivan Donchevskii
c39f28d5e0 Clang: Fix parsing for files which include qobjectdefs.h
For some reason did not work properly with include guards
before #include_next.

Change-Id: I4a314c0e4ff29487904e2daa64362c3e2a3e1859
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-20 13:44:00 +00:00
Ivan Donchevskii
1ed7d3c270 Clang: Provide example with clazy warnings
Change-Id: I23cb81d0ffe0d23428ce85ba22d85e1d6c8c1216
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-20 06:50:19 +00:00
Ivan Donchevskii
cec807f5c1 Clang: Provide example with a lot of tidy warnings
Change-Id: I6d6d2559bb8e2b6c972e88c3af9ce06968e7c959
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-20 06:50:12 +00:00
Ivan Donchevskii
66c7629814 Clang: Properly handle Q_PROPERTY in TokenInfo
Transform Q_PROPERTY into unique AST node.
Mark different parts with types and search for parent
in FullTokenInfos.

Change-Id: Iaa1ec0c73d34773edf5605d3682bd6a290d195de
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-20 06:49:47 +00:00
Nikolai Kosjar
a8f1f758a5 Clang: Fix tagging of slots with CONFIG+=no_keywords
For the CONFIG+=no_keywords case, Q_SLOTS expanded to the undefined
"slots".

Task-number: QTCREATORBUG-17371
Change-Id: I7891e4b0595647aa02c97c9f80d61f3f5459a61a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-01-03 16:47:12 +00:00
Tobias Hunger
38cce7eb83 Update License according to agreement with Free Qt Foundation
* Update all files in share folder

Change-Id: I8a82c3eb2eb614d4339dd4c4e690f54b5f29d813
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-01-19 16:05:29 +00:00
Nikolai Kosjar
4f7649633c Clang: Free us from specific Qt versions
More precisely, free us from specific Q_MOC_RUN/QT_NO_META_MACROS code
paths in QtCore/qobjectdefs.h.

In order to track signals and slots we provided custom definitions of
e.g. "Q_SIGNAL" by including qt5-qobjectdefs-injected.h with "-include".
We also had to ensure that those macros were not overwritten by Qt's
qobjectdefs.h, which we did by defining QT_NO_META_MACROS. However, this
came with a cost: we needed to replicate all the other macro definitions
in the Q_MOC_RUN/QT_NO_META_MACROS code path, e.g. Q_INTERFACES. This
bound us to specific versions of qobjectdefs.h and occasionally we had
to adapt (see change 4eafa2e02b).

The new approach wraps Qt's qobjectdefs.h with the help of
"include_next". In the wrapper header, we only redefine what is
necessary.

The "include_next" directive is originally a GNU extension. Clang seems
to support it unconditionally, as [1] implicitly states.

[1] http://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros

Change-Id: Ic1a263f94b178349cb32bfdbb074ad5e6e0761ee
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-07-27 13:12:41 +00:00
Nikolai Kosjar
4eafa2e02b Clang: Handle Q_ENUM() and Q_FLAG() in qt5-qobjectdefs-injected.h
Q_ENUM() and Q_FLAG() were added in Qt 5.5.0.

This fixes among others red/wiggly underlines of these macro's uses.

Change-Id: I059ebcc32cc271f4960b11e722e23c314c5ceac7
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-06-24 10:09:26 +00:00
Nikolai Kosjar
b7c025a5dd Clang: Respect QT_NO_*KEYWORDS in qt5-qobjectdefs-injected.h
Change-Id: I299db813c13f273a40e447c5fdde8ff8757480ba
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-06-24 10:09:21 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Robert Loehning
5292748bf2 Incremented year in copyright info
Change-Id: I6e25ba25aa2898b5382dae7f3751deebb6072efa
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-09 09:41:23 +01:00
Erik Verbruggen
5beb74fd9d Add experimental clang code-model plug-in.
Previously known as the wip/clang branch.

Contributors (in alphabetical order):
- Christian Kamm <christian.d.kamm@nokia.com>
- Erik Verbruggen <erik.verbruggen@digia.com>
- Leandro Melo <leandro.melo@nokia.com>
- Peter Kuemmel <syntheticpp@gmx.net>
- Sergey Shambir <sergey.shambir.auto@gmail.com>

Change-Id: I4c3ff600a19b6732641c1d5ef28236bf2cc17737
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-12-20 17:05:09 +01:00