1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * This file is part of the LibreOffice project. 4 * 5 * Based on LLVM/Clang. 6 * 7 * This file is distributed under the University of Illinois Open Source 8 * License. See LICENSE.TXT for details. 9 * 10 */ 11 12 #ifndef TUTORIAL3_H 13 #define TUTORIAL3_H 14 15 #include "plugin.hxx" 16 17 namespace loplugin 18 { 19 20 // Similar like for Tutorial2, but this time the base class is RewritePlugin. 21 class Tutorial3 22 : public loplugin::FilteringRewritePlugin< Tutorial3 > 23 { 24 public: 25 // One more argument for ctor. 26 Tutorial3( const InstantiationData& data ); 27 virtual void run() override; 28 // Will be called for every if statement. 29 bool VisitIfStmt( const IfStmt* ifstmt ); 30 private: 31 // Helper function to check if the statement is 'return false;' and 32 // modify it if yes. 33 void modifyReturnFalse( const Stmt* stmt ); 34 }; 35 36 } // namespace 37 38 #endif // POSTFIXINCREMENTFIX_H 39 40 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 41