diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-20 19:47:01 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-20 19:51:43 +0100 |
commit | 5dcb634dcbc5816e4b61e14ce2f05395e52ac5bf (patch) | |
tree | 5e2e534959d793e9fa6e4d2831b208cc7e633cc1 /compilerplugins/clang/pluginhandler.cxx | |
parent | 58038cb26abf7c64c2459cad9241a731ff6c687d (diff) |
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
Diffstat (limited to 'compilerplugins/clang/pluginhandler.cxx')
-rw-r--r-- | compilerplugins/clang/pluginhandler.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index d6595a3d502d..4518dd5cbca5 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -159,6 +159,11 @@ DiagnosticBuilder PluginHandler::report( DiagnosticsEngine::Level level, StringR return report( level, nullptr, message, compiler, loc ); } +bool PluginHandler::addRemoval( SourceLocation loc ) + { + return removals.insert( loc ).second; + } + void PluginHandler::HandleTranslationUnit( ASTContext& context ) { if( context.getDiagnostics().hasErrorOccurred()) |