summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/TextDiagnosticPrinter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp
index c472a140cbf..24f66dac7f4 100644
--- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -308,6 +308,11 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,
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
OpenPOWER on IntegriCloud