Stage two of getting CFE top correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/TextDiagnosticPrinter.h b/Driver/TextDiagnosticPrinter.h
new file mode 100644
index 0000000..71e584eb
--- /dev/null
+++ b/Driver/TextDiagnosticPrinter.h
@@ -0,0 +1,46 @@
+//===--- TextDiagnosticPrinter.h - Text Diagnostic Client -------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by Bill Wendling and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This is a concrete diagnostic client, which prints the diagnostics to
+// standard error.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef TEXT_DIAGNOSTIC_PRINTER_H_
+#define TEXT_DIAGNOSTIC_PRINTER_H_
+
+#include "TextDiagnostics.h"
+#include "clang/Basic/SourceLocation.h"
+
+namespace clang {
+class SourceManager;
+
+class TextDiagnosticPrinter : public TextDiagnostics {
+  SourceLocation LastWarningLoc;
+public:
+  TextDiagnosticPrinter(SourceManager &sourceMgr)
+    : TextDiagnostics(sourceMgr) {}
+
+  void PrintIncludeStack(SourceLocation Pos);
+  void HighlightRange(const SourceRange &R, unsigned LineNo,
+                      std::string &CaratLine,
+                      const std::string &SourceLine);
+  unsigned GetTokenLength(SourceLocation Loc);
+
+  virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
+                                SourceLocation Pos,
+                                diag::kind ID, const std::string *Strs,
+                                unsigned NumStrs,
+                                const SourceRange *Ranges, 
+                                unsigned NumRanges);
+};
+
+} // end namspace clang
+
+#endif