Don't attempt to actually do double code removals
...that easily works around the problem that in a rewriter rewriting types of VarDecls like T x, y; it would try to replace T twice. Also, keep the list of removals globally with the (global) rewriter. Change-Id: I55b8d11986c2a29e09ff40132fd114a0cc48dc90
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "plugin.hxx"
|
||||
|
||||
#include <set>
|
||||
|
||||
#include <clang/AST/ASTConsumer.h>
|
||||
#include <clang/Frontend/FrontendAction.h>
|
||||
|
||||
@@ -33,12 +35,14 @@ class PluginHandler
|
||||
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());
|
||||
bool addRemoval( SourceLocation loc );
|
||||
private:
|
||||
void handleOption( const string& option );
|
||||
void createPlugins( set< string > rewriters );
|
||||
DiagnosticBuilder report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc = SourceLocation());
|
||||
CompilerInstance& compiler;
|
||||
Rewriter rewriter;
|
||||
set< SourceLocation > removals;
|
||||
string scope;
|
||||
string warningsOnly;
|
||||
};
|
||||
|
Reference in New Issue
Block a user