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>
This commit is contained in:
Ivan Donchevskii
2018-01-26 15:12:38 +01:00
parent b5f63a76b2
commit 66c7629814
15 changed files with 235 additions and 27 deletions
@@ -23,11 +23,17 @@
**
****************************************************************************/
#ifndef WRAPPED_QOBJECT_DEFS_H
#define WRAPPED_QOBJECT_DEFS_H
// Include qobjectdefs.h from Qt ...
#include_next <qobjectdefs.h>
#include <utility>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmacro-redefined"
#pragma clang diagnostic ignored "-Wgnu-string-literal-operator-template"
// ...and redefine macros for tagging signals/slots
#ifdef signals
@@ -54,4 +60,15 @@
# define Q_SLOT __attribute__((annotate("qt_slot")))
#endif
template <char... chars>
using QPropertyMagicString = std::integer_sequence<char, chars...>;
template <class T, T... chars>
constexpr QPropertyMagicString<chars...> operator""_qpropstr() { return { }; }
// Create unique AST node for the property.
#define Q_PROPERTY(arg) void QPropertyMagicFunction(decltype(#arg ## _qpropstr));
#pragma clang diagnostic pop
#endif // WRAPPED_QOBJECT_DEFS_H