| 1 |
/* |
| 2 |
SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB a KDAB Group company [email protected] |
| 3 |
SPDX-FileContributor: Sérgio Martins <[email protected]> |
| 4 |
|
| 5 |
SPDX-FileCopyrightText: 2015 Sergio Martins <[email protected]> |
| 6 |
|
| 7 |
SPDX-License-Identifier: LGPL-2.0-or-later |
| 8 |
*/ |
| 9 |
|
| 10 |
#ifndef DETACHING_BASE_H |
| 11 |
#define DETACHING_BASE_H |
| 12 |
|
| 13 |
#include "checkbase.h" |
| 14 |
|
| 15 |
#include <string> |
| 16 |
|
| 17 |
namespace clang |
| 18 |
{ |
| 19 |
class CXXMethodDecl; |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Base class for checks that look for detachments. |
| 24 |
*/ |
| 25 |
class DetachingBase : public CheckBase |
| 26 |
{ |
| 27 |
public: |
| 28 |
explicit DetachingBase(const std::string &name, Options = Option_None); |
| 29 |
|
| 30 |
protected: |
| 31 |
enum DetachingMethodType { DetachingMethod, DetachingMethodWithConstCounterPart }; |
| 32 |
|
| 33 |
std::vector<clang::FixItHint> getFixitHints(llvm::StringRef className, llvm::StringRef functionName, clang::CallExpr *callExpr) const; |
| 34 |
bool isDetachingMethod(clang::CXXMethodDecl *, DetachingMethodType = DetachingMethod) const; |
| 35 |
}; |
| 36 |
|
| 37 |
#endif |