summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/LogDiagnosticPrinter.cpp
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2014-11-14 21:23:56 +0000
committerSteven Wu <stevenwu@apple.com>2014-11-14 21:23:56 +0000
commit2e2b0b3942d1a6ea5ae1f0eb67f916f974a05493 (patch)
tree7f1356c022b3c3a1f243b44391eff363e33ccb96 /clang/lib/Frontend/LogDiagnosticPrinter.cpp
parent2700d03da558c1940d1263236a4be19b6d877e92 (diff)
downloadbcm5719-llvm-2e2b0b3942d1a6ea5ae1f0eb67f916f974a05493.tar.gz
bcm5719-llvm-2e2b0b3942d1a6ea5ae1f0eb67f916f974a05493.zip
Add DiagID and Warning Flag to DiagnosticsLog
llvm-svn: 222042
Diffstat (limited to 'clang/lib/Frontend/LogDiagnosticPrinter.cpp')
-rw-r--r--clang/lib/Frontend/LogDiagnosticPrinter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Frontend/LogDiagnosticPrinter.cpp b/clang/lib/Frontend/LogDiagnosticPrinter.cpp
index c2dcd1be313..c6a18e0d80d 100644
--- a/clang/lib/Frontend/LogDiagnosticPrinter.cpp
+++ b/clang/lib/Frontend/LogDiagnosticPrinter.cpp
@@ -63,6 +63,14 @@ LogDiagnosticPrinter::EmitDiagEntry(llvm::raw_ostream &OS,
<< " ";
EmitString(OS, DE.Message) << '\n';
}
+ OS << " <key>ID</key>\n"
+ << " ";
+ EmitInteger(OS, DE.DiagnosticID) << '\n';
+ if (!DE.WarningOption.empty()) {
+ OS << " <key>WarningOption</key>\n"
+ << " ";
+ EmitString(OS, DE.WarningOption) << '\n';
+ }
OS << " </dict>\n";
}
@@ -122,6 +130,8 @@ void LogDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level,
DE.DiagnosticID = Info.getID();
DE.DiagnosticLevel = Level;
+ DE.WarningOption = DiagnosticIDs::getWarningOptionForDiag(DE.DiagnosticID);
+
// Format the message.
SmallString<100> MessageStr;
Info.FormatDiagnostic(MessageStr);
OpenPOWER on IntegriCloud