add a libDriver, for now only move the text diangostics stuff from Driver to there

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54383 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 56389df..1aa7651 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -24,9 +24,9 @@
 
 #include "clang.h"
 #include "ASTConsumers.h"
-#include "TextDiagnosticBuffer.h"
-#include "TextDiagnosticPrinter.h"
 #include "HTMLDiagnostics.h"
+#include "clang/Driver/TextDiagnosticBuffer.h"
+#include "clang/Driver/TextDiagnosticPrinter.h"
 #include "clang/Analysis/PathDiagnostic.h"
 #include "clang/AST/TranslationUnit.h"
 #include "clang/CodeGen/ModuleBuilder.h"
@@ -143,6 +143,16 @@
          llvm::cl::desc("Generate HTML to report diagnostics"),
          llvm::cl::value_desc("HTML directory"));
 
+static llvm::cl::opt<bool>
+NoShowColumn("fno-show-column",
+             llvm::cl::desc("Do not include column number on diagnostics"));
+
+static llvm::cl::opt<bool>
+NoCaretDiagnostics("fno-caret-diagnostics",
+                   llvm::cl::desc("Do not include source line and caret with"
+                                  " diagnostics"));
+
+
 //===----------------------------------------------------------------------===//
 // Analyzer Options
 //===----------------------------------------------------------------------===//
@@ -426,7 +436,7 @@
 
 static llvm::cl::opt<bool>
 ObjCEnableGC("fobjc-gc",
-             llvm::cl::desc("Enable Objective-C garbage collection"));             
+             llvm::cl::desc("Enable Objective-C garbage collection"));
 
 void InitializeGCMode(LangOptions &Options) {
   if (ObjCExclusiveGC)
@@ -1392,7 +1402,8 @@
   else { // Use Text diagnostics.
     if (!VerifyDiagnostics) {
       // Print diagnostics to stderr by default.
-      TextDiagClient = new TextDiagnosticPrinter();
+      TextDiagClient = new TextDiagnosticPrinter(!NoShowColumn,
+          !NoCaretDiagnostics);
     } else {
       // When checking diagnostics, just buffer them up.
       TextDiagClient = new TextDiagnosticBuffer();