| 1 |
/* |
| 2 |
SPDX-FileCopyrightText: 2016 Sergio Martins <[email protected]> |
| 3 |
|
| 4 |
SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef CLAZY_CONTAINER_ANTI_PATTERN_H |
| 8 |
#define CLAZY_CONTAINER_ANTI_PATTERN_H |
| 9 |
|
| 10 |
#include "checkbase.h" |
| 11 |
|
| 12 |
/** |
| 13 |
* Warns when there are unneeded allocations of temporary lists because of using values(), keys() |
| 14 |
* toVector() or toList(). |
| 15 |
* |
| 16 |
* See README-anti-pattern for more information |
| 17 |
*/ |
| 18 |
class ContainerAntiPattern : public CheckBase |
| 19 |
{ |
| 20 |
public: |
| 21 |
using CheckBase::CheckBase; |
| 22 |
void VisitStmt(clang::Stmt *stmt) override; |
| 23 |
|
| 24 |
private: |
| 25 |
bool VisitQSet(clang::Stmt *stmt); |
| 26 |
bool handleLoop(clang::Stmt *); |
| 27 |
}; |
| 28 |
|
| 29 |
#endif |