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
|
||||
{
|
||||
|
||||
LclStaticFix::LclStaticFix( ASTContext& context, Rewriter& rewriter )
|
||||
: RewritePlugin( context, rewriter )
|
||||
LclStaticFix::LclStaticFix( CompilerInstance& compiler, Rewriter& rewriter )
|
||||
: RewritePlugin( compiler, rewriter )
|
||||
{
|
||||
}
|
||||
|
||||
void LclStaticFix::run()
|
||||
{
|
||||
TraverseDecl( context.getTranslationUnitDecl());
|
||||
TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
|
||||
}
|
||||
|
||||
bool LclStaticFix::VisitFunctionDecl( FunctionDecl* declaration )
|
||||
|
@ -21,7 +21,7 @@ class LclStaticFix
|
||||
, public RewritePlugin
|
||||
{
|
||||
public:
|
||||
explicit LclStaticFix( ASTContext& context, Rewriter& rewriter );
|
||||
explicit LclStaticFix( CompilerInstance& compiler, Rewriter& rewriter );
|
||||
virtual void run();
|
||||
bool VisitFunctionDecl( FunctionDecl* declaration );
|
||||
};
|
||||
|
@ -20,8 +20,8 @@ namespace loplugin
|
||||
{
|
||||
|
||||
// Ctor, nothing special, pass the argument(s).
|
||||
Tutorial1::Tutorial1( ASTContext& context )
|
||||
: Plugin( context )
|
||||
Tutorial1::Tutorial1( CompilerInstance& compiler )
|
||||
: Plugin( compiler )
|
||||
{
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ void Tutorial1::run()
|
||||
{
|
||||
// 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.
|
||||
TraverseDecl( context.getTranslationUnitDecl());
|
||||
TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
|
||||
}
|
||||
|
||||
// This function is called for every return statement.
|
||||
|
@ -25,7 +25,7 @@ class Tutorial1
|
||||
{
|
||||
public:
|
||||
// Ctor, nothing special.
|
||||
Tutorial1( ASTContext& context );
|
||||
Tutorial1( CompilerInstance& compiler );
|
||||
// The function that will be called to perform the actual action.
|
||||
virtual void run();
|
||||
// Function from Clang, it will be called for every return statement in the source.
|
||||
|
@ -21,15 +21,15 @@ if( a == 1 )
|
||||
namespace loplugin
|
||||
{
|
||||
|
||||
Tutorial2::Tutorial2( ASTContext& context )
|
||||
: Plugin( context )
|
||||
Tutorial2::Tutorial2( CompilerInstance& compiler )
|
||||
: Plugin( compiler )
|
||||
{
|
||||
}
|
||||
|
||||
void Tutorial2::run()
|
||||
{
|
||||
// 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.
|
||||
|
@ -22,7 +22,7 @@ class Tutorial2
|
||||
, public Plugin
|
||||
{
|
||||
public:
|
||||
Tutorial2( ASTContext& context );
|
||||
Tutorial2( CompilerInstance& compiler );
|
||||
virtual void run();
|
||||
// Will be called for every if statement.
|
||||
bool VisitIfStmt( IfStmt* ifstmt );
|
||||
|
@ -21,14 +21,14 @@ namespace loplugin
|
||||
{
|
||||
|
||||
// Ctor, pass arguments.
|
||||
Tutorial3::Tutorial3( ASTContext& context, Rewriter& rewriter )
|
||||
: RewritePlugin( context, rewriter )
|
||||
Tutorial3::Tutorial3( CompilerInstance& compiler, Rewriter& rewriter )
|
||||
: RewritePlugin( compiler, rewriter )
|
||||
{
|
||||
}
|
||||
|
||||
void Tutorial3::run()
|
||||
{
|
||||
TraverseDecl( context.getTranslationUnitDecl());
|
||||
TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
|
||||
}
|
||||
|
||||
bool Tutorial3::VisitIfStmt( IfStmt* ifstmt )
|
||||
|
@ -23,7 +23,7 @@ class Tutorial3
|
||||
{
|
||||
public:
|
||||
// One more argument for ctor.
|
||||
Tutorial3( ASTContext& context, Rewriter& rewriter );
|
||||
Tutorial3( CompilerInstance& compiler, Rewriter& rewriter );
|
||||
virtual void run();
|
||||
// Will be called for every if statement.
|
||||
bool VisitIfStmt( IfStmt* ifstmt );
|
||||
|
Loading…
x
Reference in New Issue
Block a user