File indexing completed on 2024-04-28 05:38:28
0001 /* 0002 SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB a KDAB Group company info@kdab.com 0003 SPDX-FileContributor: Sérgio Martins <sergio.martins@kdab.com> 0004 0005 SPDX-FileCopyrightText: 2015 Sergio Martins <smartins@kde.org> 0006 0007 SPDX-License-Identifier: LGPL-2.0-or-later 0008 */ 0009 0010 #ifndef CLANG_WRITING_TO_TEMPORARY_H 0011 #define CLANG_WRITING_TO_TEMPORARY_H 0012 0013 #include "checkbase.h" 0014 0015 #include <string> 0016 0017 class ClazyContext; 0018 0019 namespace clang 0020 { 0021 class ImplicitCastExpr; 0022 class Stmt; 0023 class CallExpr; 0024 } 0025 0026 /** 0027 * Finds places where writing to temporaries, which is a nop. 0028 * 0029 * See README-writing-to-temporary for more information 0030 */ 0031 class WritingToTemporary : public CheckBase 0032 { 0033 public: 0034 explicit WritingToTemporary(const std::string &name, ClazyContext *context); 0035 void VisitStmt(clang::Stmt *stmt) override; 0036 0037 private: 0038 const bool m_widenCriteria; 0039 }; 0040 0041 #endif