Changeset View
Changeset View
Standalone View
Standalone View
src/checks/manuallevel/jnisignatures.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | This file is part of the clazy static checker. | ||||
3 | | ||||
4 | Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com | ||||
5 | Author: Nicolas Fella <nicolas.fella@kdab.com> | ||||
6 | | ||||
7 | This library is free software; you can redistribute it and/or | ||||
8 | modify it under the terms of the GNU Library General Public | ||||
9 | License as published by the Free Software Foundation; either | ||||
10 | version 2 of the License, or (at your option) any later version. | ||||
11 | | ||||
12 | This library is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | Library General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU Library General Public License | ||||
18 | along with this library; see the file COPYING.LIB. If not, write to | ||||
19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
20 | Boston, MA 02110-1301, USA. | ||||
21 | */ | ||||
22 | | ||||
23 | #ifndef JNISIGNATURES_H | ||||
24 | #define JNISIGNATURES_H | ||||
25 | | ||||
26 | #include "checkbase.h" | ||||
27 | | ||||
28 | #include <string> | ||||
29 | | ||||
30 | class ClazyContext; | ||||
31 | namespace clang { | ||||
32 | class Stmt; | ||||
33 | class CXXMemberCallExpr; | ||||
34 | class FunctionDecl; | ||||
35 | } // namespace clang | ||||
36 | | ||||
37 | class JniSignatures | ||||
38 | : public CheckBase | ||||
39 | { | ||||
40 | public: | ||||
41 | JniSignatures(const std::string &name, ClazyContext *context); | ||||
42 | void VisitStmt(clang::Stmt *) override; | ||||
43 | private: | ||||
44 | template<typename T> | ||||
45 | void checkArgAt(T *call, unsigned int index); | ||||
46 | void checkConstructorCall(clang::Stmt *stm); | ||||
47 | void checkFunctionCall(clang::Stmt *stm); | ||||
48 | bool functionShouldBeChecked(clang::FunctionDecl *funDecl); | ||||
49 | }; | ||||
50 | | ||||
51 | #endif | ||||
52 | |