From 74e2c35fbc62d643358518cf83e9651c347ea8f5 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 25 Sep 2011 23:01:05 +0000 Subject: Inline this method now that its completely trivial, and prepare for hoisting parts of the text diagnostic. llvm-svn: 140477 --- clang/lib/Frontend/TextDiagnosticPrinter.cpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'clang/lib/Frontend') diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp index 51c3b8ea9cb..34dad73e1e0 100644 --- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp @@ -763,21 +763,6 @@ private: } // end namespace -void TextDiagnosticPrinter::EmitCaretDiagnostic( - SourceLocation Loc, - SmallVectorImpl& Ranges, - const SourceManager &SM, - ArrayRef Hints) { - assert(LangOpts && "Unexpected diagnostic outside source file processing"); - assert(DiagOpts && "Unexpected diagnostic without options set"); - - // FIXME: Remove this method and have clients directly build and call Emit on - // the TextDiagnostic object. - TextDiagnostic TextDiag(*this, OS, SM, *LangOpts, *DiagOpts); - unsigned MacroDepth = 0; - TextDiag.Emit(Loc, Ranges, Hints, MacroDepth); -} - /// \brief Skip over whitespace in the string, starting at the given /// index. /// @@ -1244,9 +1229,15 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, Ranges.push_back(Hint.RemoveRange); } - EmitCaretDiagnostic(LastLoc, Ranges, LastLoc.getManager(), - llvm::makeArrayRef(Info.getFixItHints(), - Info.getNumFixItHints())); + assert(LangOpts && "Unexpected diagnostic outside source file processing"); + assert(DiagOpts && "Unexpected diagnostic without options set"); + + TextDiagnostic TextDiag(*this, OS, Info.getSourceManager(), + *LangOpts, *DiagOpts); + unsigned MacroDepth = 0; + TextDiag.Emit(LastLoc, Ranges, llvm::makeArrayRef(Info.getFixItHints(), + Info.getNumFixItHints()), + MacroDepth); } OS.flush(); -- cgit v1.2.3