Debian Codegraph @

src/checks/level1/incorrect-emit.h

raw
1 /*
2 SPDX-FileCopyrightText: 2016 Sergio Martins <[email protected]>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7 #ifndef CLAZY_INCORRECT_EMIT_H
8 #define CLAZY_INCORRECT_EMIT_H
9
10 #include "checkbase.h"
11
12 #include <clang/Basic/SourceLocation.h>
13
14 #include <string>
15 #include <vector>
16
17 namespace clang
18 {
19 class CXXMemberCallExpr;
20 }
21
22 /**
23 * See README-incorrect-emit.md for more info.
24 */
25 class IncorrectEmit : public CheckBase
26 {
27 public:
28 explicit IncorrectEmit(const std::string &name, Options options);
29 void VisitStmt(clang::Stmt *stmt) override;
30
31 private:
32 void checkCallSignalInsideCTOR(clang::CXXMemberCallExpr *);
33 void VisitMacroExpands(const clang::Token &MacroNameTok, const clang::SourceRange &range, const clang::MacroInfo *minfo = nullptr) override;
34 bool hasEmitKeyboard(clang::CXXMemberCallExpr *) const;
35 std::vector<clang::SourceLocation> m_emitLocations;
36 };
37
38 #endif