summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/plugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/plugin.cxx')
-rw-r--r--compilerplugins/clang/plugin.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index f6c81f566ed1..75d55782009c 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -20,20 +20,20 @@ Base classes for plugin actions.
namespace loplugin
{
-Plugin::Plugin( ASTContext& context )
- : context( context )
+Plugin::Plugin( CompilerInstance& compiler )
+ : compiler( compiler )
{
}
DiagnosticBuilder Plugin::report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc )
{
- return report( level, message, context, loc );
+ return report( level, message, compiler, loc );
}
-DiagnosticBuilder Plugin::report( DiagnosticsEngine::Level level, StringRef message, ASTContext& context,
+DiagnosticBuilder Plugin::report( DiagnosticsEngine::Level level, StringRef message, CompilerInstance& compiler,
SourceLocation loc )
{
- DiagnosticsEngine& diag = context.getDiagnostics();
+ DiagnosticsEngine& diag = compiler.getDiagnostics();
#if 0
// Do some mappings (e.g. for -Werror) that clang does not do for custom messages for some reason.
if( level == DiagnosticsEngine::Warning && diag.getWarningsAsErrors())
@@ -50,10 +50,10 @@ DiagnosticBuilder Plugin::report( DiagnosticsEngine::Level level, StringRef mess
bool Plugin::ignoreLocation( SourceLocation loc )
{
- SourceLocation expansionLoc = context.getSourceManager().getExpansionLoc( loc );
- if( context.getSourceManager().isInSystemHeader( expansionLoc ))
+ SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( loc );
+ if( compiler.getSourceManager().isInSystemHeader( expansionLoc ))
return true;
- const char* bufferName = context.getSourceManager().getPresumedLoc( expansionLoc ).getFilename();
+ const char* bufferName = compiler.getSourceManager().getPresumedLoc( expansionLoc ).getFilename();
if( bufferName == NULL )
return true;
if( strncmp( bufferName, OUTDIR, strlen( OUTDIR )) == 0
@@ -64,15 +64,15 @@ bool Plugin::ignoreLocation( SourceLocation loc )
return true;
}
-void Plugin::registerPlugin( Plugin* (*create)( ASTContext&, Rewriter& ), const char* optionName, bool isRewriter )
+void Plugin::registerPlugin( Plugin* (*create)( CompilerInstance&, Rewriter& ), const char* optionName, bool isRewriter )
{
PluginHandler::registerPlugin( create, optionName, isRewriter );
}
/////
-RewritePlugin::RewritePlugin( ASTContext& context, Rewriter& rewriter )
- : Plugin( context )
+RewritePlugin::RewritePlugin( CompilerInstance& compiler, Rewriter& rewriter )
+ : Plugin( compiler )
, rewriter( rewriter )
{
}