| 1 |
/* |
| 2 |
SPDX-FileCopyrightText: 2015 Sergio Martins <[email protected]> |
| 3 |
|
| 4 |
SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef CLANG_MISSING_Q_OBJECT_H |
| 8 |
#define CLANG_MISSING_Q_OBJECT_H |
| 9 |
|
| 10 |
#include "checkbase.h" |
| 11 |
|
| 12 |
#include <vector> |
| 13 |
|
| 14 |
namespace clang |
| 15 |
{ |
| 16 |
class SourceLocation; |
| 17 |
class MacroInfo; |
| 18 |
class Token; |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Finds QObject derived classes that don't have a Q_OBJECT macro |
| 23 |
* |
| 24 |
* See README-missing-qobject for more information |
| 25 |
*/ |
| 26 |
class MissingQObjectMacro : public CheckBase |
| 27 |
{ |
| 28 |
public: |
| 29 |
using CheckBase::CheckBase; |
| 30 |
void VisitDecl(clang::Decl *decl) override; |
| 31 |
|
| 32 |
private: |
| 33 |
void VisitMacroExpands(const clang::Token &MacroNameTok, const clang::SourceRange &range, const clang::MacroInfo *minfo = nullptr) override; |
| 34 |
void registerQ_OBJECT(clang::SourceLocation); |
| 35 |
std::vector<clang::SourceLocation> m_qobjectMacroLocations; |
| 36 |
|
| 37 |
bool m_hasAddedMocFile = false; |
| 38 |
}; |
| 39 |
|
| 40 |
#endif |