From a9b01eb77641cce46dcc69bce27635a72187a89c Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Wed, 25 Feb 2015 14:40:56 +0000 Subject: Add support for inserting ArrayRef into DiagnosticBuilder. This is going to be needed in clang-tidy as more checks add complex fixits. llvm-svn: 230495 --- clang/lib/Sema/SemaChecking.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'clang/lib/Sema/SemaChecking.cpp') diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index c26ba3cf9bb..409a1b6ebd5 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -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::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::iterator I = FixIt.begin(), E = FixIt.end(); - I != E; ++I) { - Note << *I; - } + Note << FixIt; } } -- cgit v1.2.3