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:
Stephan Bergmann
2014-02-20 19:47:01 +01:00
parent 58038cb26a
commit 5dcb634dcb
4 changed files with 27 additions and 12 deletions

View File

@@ -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())