forked from OSchip/llvm-project
Add DiagID and Warning Flag to DiagnosticsLog
llvm-svn: 222042
This commit is contained in:
parent
2700d03da5
commit
2e2b0b3942
|
@ -35,6 +35,9 @@ class LogDiagnosticPrinter : public DiagnosticConsumer {
|
|||
|
||||
/// The ID of the diagnostic.
|
||||
unsigned DiagnosticID;
|
||||
|
||||
/// The Option Flag for the diagnostic
|
||||
std::string WarningOption;
|
||||
|
||||
/// The level of the diagnostic.
|
||||
DiagnosticsEngine::Level DiagnosticLevel;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue