Add support for inserting ArrayRef<FixItHint> into DiagnosticBuilder.

This is going to be needed in clang-tidy as more checks add complex fixits.

llvm-svn: 230495
This commit is contained in:
Alexander Kornienko
2015-02-25 14:40:56 +00:00
parent c9c7a3e4e5
commit a9b01eb776
2 changed files with 11 additions and 10 deletions

View File

@@ -3152,10 +3152,7 @@ void CheckFormatHandler::EmitFormatDiagnostic(Sema &S, bool InFunctionCall,
if (InFunctionCall) {
const Sema::SemaDiagnosticBuilder &D = S.Diag(Loc, PDiag);
D << StringRange;
for (ArrayRef<FixItHint>::iterator I = FixIt.begin(), E = FixIt.end();
I != E; ++I) {
D << *I;
}
D << FixIt;
} else {
S.Diag(IsStringLocation ? ArgumentExpr->getExprLoc() : Loc, PDiag)
<< ArgumentExpr->getSourceRange();
@@ -3165,10 +3162,7 @@ void CheckFormatHandler::EmitFormatDiagnostic(Sema &S, bool InFunctionCall,
diag::note_format_string_defined);
Note << StringRange;
for (ArrayRef<FixItHint>::iterator I = FixIt.begin(), E = FixIt.end();
I != E; ++I) {
Note << *I;
}
Note << FixIt;
}
}