adjust unused compiler plugins for ASTContext to CompilerInstance change too
Change-Id: I415ed25586408d7e7df9457f7c637a8c6d13d35d
This commit is contained in:
parent
153a69cad2
commit
c63e6c38c9
@ -19,14 +19,14 @@ Check all lcl_ functions and prepend static if needed.
|
|||||||
namespace loplugin
|
namespace loplugin
|
||||||
{
|
{
|
||||||
|
|
||||||
LclStaticFix::LclStaticFix( ASTContext& context, Rewriter& rewriter )
|
LclStaticFix::LclStaticFix( CompilerInstance& compiler, Rewriter& rewriter )
|
||||||
: RewritePlugin( context, rewriter )
|
: RewritePlugin( compiler, rewriter )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LclStaticFix::run()
|
void LclStaticFix::run()
|
||||||
{
|
{
|
||||||
TraverseDecl( context.getTranslationUnitDecl());
|
TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LclStaticFix::VisitFunctionDecl( FunctionDecl* declaration )
|
bool LclStaticFix::VisitFunctionDecl( FunctionDecl* declaration )
|
||||||
|
@ -21,7 +21,7 @@ class LclStaticFix
|
|||||||
, public RewritePlugin
|
, public RewritePlugin
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit LclStaticFix( ASTContext& context, Rewriter& rewriter );
|
explicit LclStaticFix( CompilerInstance& compiler, Rewriter& rewriter );
|
||||||
virtual void run();
|
virtual void run();
|
||||||
bool VisitFunctionDecl( FunctionDecl* declaration );
|
bool VisitFunctionDecl( FunctionDecl* declaration );
|
||||||
};
|
};
|
||||||
|
@ -20,8 +20,8 @@ namespace loplugin
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Ctor, nothing special, pass the argument(s).
|
// Ctor, nothing special, pass the argument(s).
|
||||||
Tutorial1::Tutorial1( ASTContext& context )
|
Tutorial1::Tutorial1( CompilerInstance& compiler )
|
||||||
: Plugin( context )
|
: Plugin( compiler )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ void Tutorial1::run()
|
|||||||
{
|
{
|
||||||
// Traverse the whole AST of the translation unit (i.e. examine the whole source file).
|
// Traverse the whole AST of the translation unit (i.e. examine the whole source file).
|
||||||
// The Clang AST helper class will call VisitReturnStmt for every return statement.
|
// The Clang AST helper class will call VisitReturnStmt for every return statement.
|
||||||
TraverseDecl( context.getTranslationUnitDecl());
|
TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function is called for every return statement.
|
// This function is called for every return statement.
|
||||||
|
@ -25,7 +25,7 @@ class Tutorial1
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Ctor, nothing special.
|
// Ctor, nothing special.
|
||||||
Tutorial1( ASTContext& context );
|
Tutorial1( CompilerInstance& compiler );
|
||||||
// The function that will be called to perform the actual action.
|
// The function that will be called to perform the actual action.
|
||||||
virtual void run();
|
virtual void run();
|
||||||
// Function from Clang, it will be called for every return statement in the source.
|
// Function from Clang, it will be called for every return statement in the source.
|
||||||
|
@ -21,15 +21,15 @@ if( a == 1 )
|
|||||||
namespace loplugin
|
namespace loplugin
|
||||||
{
|
{
|
||||||
|
|
||||||
Tutorial2::Tutorial2( ASTContext& context )
|
Tutorial2::Tutorial2( CompilerInstance& compiler )
|
||||||
: Plugin( context )
|
: Plugin( compiler )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tutorial2::run()
|
void Tutorial2::run()
|
||||||
{
|
{
|
||||||
// The Clang AST helper class will call VisitIfStmt for every if statement.
|
// The Clang AST helper class will call VisitIfStmt for every if statement.
|
||||||
TraverseDecl( context.getTranslationUnitDecl());
|
TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function is called for every if statement.
|
// This function is called for every if statement.
|
||||||
|
@ -22,7 +22,7 @@ class Tutorial2
|
|||||||
, public Plugin
|
, public Plugin
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Tutorial2( ASTContext& context );
|
Tutorial2( CompilerInstance& compiler );
|
||||||
virtual void run();
|
virtual void run();
|
||||||
// Will be called for every if statement.
|
// Will be called for every if statement.
|
||||||
bool VisitIfStmt( IfStmt* ifstmt );
|
bool VisitIfStmt( IfStmt* ifstmt );
|
||||||
|
@ -21,14 +21,14 @@ namespace loplugin
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Ctor, pass arguments.
|
// Ctor, pass arguments.
|
||||||
Tutorial3::Tutorial3( ASTContext& context, Rewriter& rewriter )
|
Tutorial3::Tutorial3( CompilerInstance& compiler, Rewriter& rewriter )
|
||||||
: RewritePlugin( context, rewriter )
|
: RewritePlugin( compiler, rewriter )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tutorial3::run()
|
void Tutorial3::run()
|
||||||
{
|
{
|
||||||
TraverseDecl( context.getTranslationUnitDecl());
|
TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Tutorial3::VisitIfStmt( IfStmt* ifstmt )
|
bool Tutorial3::VisitIfStmt( IfStmt* ifstmt )
|
||||||
|
@ -23,7 +23,7 @@ class Tutorial3
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// One more argument for ctor.
|
// One more argument for ctor.
|
||||||
Tutorial3( ASTContext& context, Rewriter& rewriter );
|
Tutorial3( CompilerInstance& compiler, Rewriter& rewriter );
|
||||||
virtual void run();
|
virtual void run();
|
||||||
// Will be called for every if statement.
|
// Will be called for every if statement.
|
||||||
bool VisitIfStmt( IfStmt* ifstmt );
|
bool VisitIfStmt( IfStmt* ifstmt );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user