implement framework for -fdiagnostics-show-option, but tblgen isn't
passing down the right info yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69268 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp
index c472a14..24f66da 100644
--- a/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -308,6 +308,11 @@
   llvm::SmallString<100> OutStr;
   Info.FormatDiagnostic(OutStr);
   OS.write(OutStr.begin(), OutStr.size());
+  
+  if (PrintDiagnosticOption)
+    if (const char *Option = Diagnostic::getWarningOptionForDiag(Info.getID()))
+      OS << " [-" << Option << ']';
+  
   OS << '\n';
   
   // If caret diagnostics are enabled and we have location, we want to