append [loplugin] automatically in report() rathen than manually everywhere

Change-Id: I2f98622f152ae0c7ac8d1113d6380f686ac7234c
This commit is contained in:
Luboš Luňák
2013-02-02 19:38:56 +01:00
parent b4392c575e
commit f5ee30c3ee
6 changed files with 21 additions and 20 deletions

View File

@@ -42,10 +42,11 @@ DiagnosticBuilder Plugin::report( DiagnosticsEngine::Level level, StringRef mess
if( level == DiagnosticsEngine::Error && diag.getErrorsAsFatal())
level = DiagnosticsEngine::Fatal;
#endif
string fullMessage = ( message + " [loplugin]" ).str();
if( loc.isValid())
return diag.Report( loc, diag.getCustomDiagID( level, message ));
return diag.Report( loc, diag.getCustomDiagID( level, fullMessage ));
else
return diag.Report( diag.getCustomDiagID( level, message ));
return diag.Report( diag.getCustomDiagID( level, fullMessage ));
}
bool Plugin::ignoreLocation( SourceLocation loc )
@@ -174,7 +175,7 @@ bool RewritePlugin::replaceText( SourceRange range, SourceRange replacementRange
bool RewritePlugin::reportEditFailure( SourceLocation loc )
{
report( DiagnosticsEngine::Warning, "cannot perform source modification (macro expansion involved?) [loplugin]", loc );
report( DiagnosticsEngine::Warning, "cannot perform source modification (macro expansion involved?)", loc );
return false;
}