Prepare dual-mode compiler plugin feature
...which can act as either a rewriter or a non-rewriter that emits warnings. Also added COMPILER_PLUGIN_WARNINGS_ONLY=X to demote warnings from plugin X from errors to warnings, even under --enable-werror. Change-Id: I05361936240a890515c6bba2459565417c1746b7
This commit is contained in:
@@ -30,7 +30,9 @@ class PluginHandler
|
||||
PluginHandler( CompilerInstance& compiler, const vector< string >& args );
|
||||
virtual ~PluginHandler();
|
||||
virtual void HandleTranslationUnit( ASTContext& context ) override;
|
||||
static void registerPlugin( Plugin* (*create)( CompilerInstance&, Rewriter& ), const char* optionName, bool isRewriter, bool isPPCallback );
|
||||
static void registerPlugin( Plugin* (*create)( const Plugin::InstantiationData& ), const char* optionName, bool isPPCallback, bool byDefault );
|
||||
DiagnosticBuilder report( DiagnosticsEngine::Level level, const char * plugin, StringRef message,
|
||||
CompilerInstance& compiler, SourceLocation loc = SourceLocation());
|
||||
private:
|
||||
void handleOption( const string& option );
|
||||
void createPlugin( const string& name );
|
||||
@@ -38,6 +40,7 @@ class PluginHandler
|
||||
CompilerInstance& compiler;
|
||||
Rewriter rewriter;
|
||||
string scope;
|
||||
string warningsOnly;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user