| 1 |
/* |
| 2 |
SPDX-FileCopyrightText: 2016 Sergio Martins <[email protected]> |
| 3 |
|
| 4 |
SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef CLAZY_QT_MACROS_H |
| 8 |
#define CLAZY_QT_MACROS_H |
| 9 |
|
| 10 |
#include "checkbase.h" |
| 11 |
|
| 12 |
#include <clang/Basic/SourceLocation.h> |
| 13 |
|
| 14 |
class QtMacrosPreprocessorCallbacks; |
| 15 |
|
| 16 |
namespace clang |
| 17 |
{ |
| 18 |
class Token; |
| 19 |
} // namespace clang |
| 20 |
|
| 21 |
/** |
| 22 |
* See README-qt-macros for more info. |
| 23 |
*/ |
| 24 |
class QtMacros : public CheckBase |
| 25 |
{ |
| 26 |
public: |
| 27 |
using CheckBase::CheckBase; |
| 28 |
|
| 29 |
private: |
| 30 |
void checkIfDef(const clang::Token &MacroNameTok, clang::SourceLocation Loc); |
| 31 |
void VisitMacroDefined(const clang::Token &MacroNameTok) override; |
| 32 |
void VisitDefined(const clang::Token ¯oNameTok, const clang::SourceRange &range) override; |
| 33 |
void VisitIfdef(clang::SourceLocation loc, const clang::Token ¯oNameTok) override; |
| 34 |
|
| 35 |
bool m_OSMacroExists = false; |
| 36 |
}; |
| 37 |
|
| 38 |
#endif |