adjust unused compiler plugins for ASTContext to CompilerInstance change too

Change-Id: I415ed25586408d7e7df9457f7c637a8c6d13d35d
This commit is contained in:
Luboš Luňák 2013-03-28 18:07:09 +01:00
parent 153a69cad2
commit c63e6c38c9
8 changed files with 16 additions and 16 deletions

View File

@ -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 )

View File

@ -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 );
}; };

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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 );

View File

@ -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 )

View File

@ -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 );