2013-09-21 14:42:35 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2013-02-02 22:59:17 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* Based on LLVM/Clang.
|
|
|
|
*
|
|
|
|
* This file is distributed under the University of Illinois Open Source
|
|
|
|
* License. See LICENSE.TXT for details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TUTORIAL3_H
|
|
|
|
#define TUTORIAL3_H
|
|
|
|
|
|
|
|
#include "plugin.hxx"
|
|
|
|
|
|
|
|
namespace loplugin
|
|
|
|
{
|
|
|
|
|
|
|
|
// Similar like for Tutorial2, but this time the base class is RewritePlugin.
|
|
|
|
class Tutorial3
|
2018-08-13 17:24:26 +02:00
|
|
|
: public loplugin::FilteringRewritePlugin< Tutorial3 >
|
2013-02-02 22:59:17 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// One more argument for ctor.
|
2014-07-23 00:02:35 -03:00
|
|
|
Tutorial3( const InstantiationData& data );
|
2013-05-31 18:34:11 +02:00
|
|
|
virtual void run() override;
|
2013-02-02 22:59:17 +01:00
|
|
|
// Will be called for every if statement.
|
2013-05-02 18:17:32 +02:00
|
|
|
bool VisitIfStmt( const IfStmt* ifstmt );
|
2013-02-02 22:59:17 +01:00
|
|
|
private:
|
|
|
|
// Helper function to check if the statement is 'return false;' and
|
|
|
|
// modify it if yes.
|
|
|
|
void modifyReturnFalse( const Stmt* stmt );
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif // POSTFIXINCREMENTFIX_H
|
|
|
|
|
2013-09-21 14:42:35 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|