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:
Luboš Luňák
2013-03-21 16:42:10 +01:00
parent 9ab15ecc4f
commit 153a69cad2
15 changed files with 67 additions and 65 deletions

View File

@@ -26,15 +26,15 @@ class PluginHandler
: public ASTConsumer
{
public:
PluginHandler( ASTContext& context, const vector< string >& args );
PluginHandler( CompilerInstance& compiler, const vector< string >& args );
virtual ~PluginHandler();
virtual void HandleTranslationUnit( ASTContext& context );
static void registerPlugin( Plugin* (*create)( ASTContext&, Rewriter& ), const char* optionName, bool isRewriter );
static void registerPlugin( Plugin* (*create)( CompilerInstance&, Rewriter& ), const char* optionName, bool isRewriter );
private:
void handleOption( const string& option );
void createPlugin( const string& name );
DiagnosticBuilder report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc = SourceLocation());
ASTContext& context;
CompilerInstance& compiler;
Rewriter rewriter;
string scope;
};