]> granicus.if.org Git - clang/commitdiff
Inline this method now that its completely trivial, and prepare for
authorChandler Carruth <chandlerc@gmail.com>
Sun, 25 Sep 2011 23:01:05 +0000 (23:01 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 25 Sep 2011 23:01:05 +0000 (23:01 +0000)
hoisting parts of the text diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140477 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/TextDiagnosticPrinter.h
lib/Frontend/TextDiagnosticPrinter.cpp

index 354df101e671cc5a39cee92d3ad9481e3eec0072..52c95c9c2dd76a3b9d4374ce7b5d4da60bcc3c1e 100644 (file)
@@ -64,12 +64,6 @@ private:
                          const DiagnosticInfo &Info,
                          const SourceManager &SM,
                          PresumedLoc PLoc);
-
-  void EmitCaretDiagnostic(SourceLocation Loc,
-                           SmallVectorImpl<CharSourceRange> &Ranges,
-                           const SourceManager &SM,
-                           ArrayRef<FixItHint> Hints);
-  
 };
 
 } // end namespace clang
index 51c3b8ea9cbf813746331030d2d058f7e5621808..34dad73e1e0f9b136f2b51f8660c44aa67271fad 100644 (file)
@@ -763,21 +763,6 @@ private:
 
 } // end namespace
 
-void TextDiagnosticPrinter::EmitCaretDiagnostic(
-    SourceLocation Loc,
-    SmallVectorImpl<CharSourceRange>& Ranges,
-    const SourceManager &SM,
-    ArrayRef<FixItHint> 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();