fix loplugin rewriter source range checking

after
    commit 94ab8e4360
    Date:   Fri Feb 9 15:28:41 2018 +0200
    improve loplugin rewriter double source modification detection

Change-Id: Ibf0a64fe4cc3dd6bf5ae16672b3d748a842196e4
This commit is contained in:
Noel Grandin
2018-02-12 10:23:59 +02:00
parent acd16c7e29
commit fc80919370
3 changed files with 41 additions and 10 deletions

View File

@@ -250,10 +250,17 @@ bool PluginHandler::checkOverlap(SourceRange range)
if (p1 <= rPair.second && rPair.first <= p2)
return false;
}
mvModifiedRanges.emplace_back(p1, p2);
return true;
}
void PluginHandler::addSourceModification(SourceRange range)
{
SourceManager& SM = compiler.getSourceManager();
char const *p1 = SM.getCharacterData( range.getBegin() );
char const *p2 = SM.getCharacterData( range.getEnd() );
mvModifiedRanges.emplace_back(p1, p2);
}
void PluginHandler::HandleTranslationUnit( ASTContext& context )
{
if( context.getDiagnostics().hasErrorOccurred())