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:
@@ -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())
|
||||
|
Reference in New Issue
Block a user