pass around CompilerInstance rather than ASTContext
It's possible to get the latter from the former, and the former is useful for other things too (access to the preprocessor, for example). Change-Id: I708d709129fd3a35bf7c63da4de09c2e696b382d
This commit is contained in:
@@ -30,14 +30,14 @@ SAL_WARN_UNUSED (see e.g. OUString). For external classes such as std::vector
|
||||
that cannot be edited there is a manual list below.
|
||||
*/
|
||||
|
||||
UnusedVariableCheck::UnusedVariableCheck( ASTContext& context )
|
||||
: Plugin( context )
|
||||
UnusedVariableCheck::UnusedVariableCheck( CompilerInstance& compiler )
|
||||
: Plugin( compiler )
|
||||
{
|
||||
}
|
||||
|
||||
void UnusedVariableCheck::run()
|
||||
{
|
||||
TraverseDecl( context.getTranslationUnitDecl());
|
||||
TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
|
||||
}
|
||||
|
||||
bool UnusedVariableCheck::VisitVarDecl( VarDecl* var )
|
||||
|
Reference in New Issue
Block a user