forked from OSchip/llvm-project
TextDiagnosticPrinter: use the mapped level for remark flag computation
Custom diagnostics don't have a builtin class so this wouldn't have worked. Reduces surface area of remark-related changes. No test coverage. llvm-svn: 211462
This commit is contained in:
parent
f1ffc84f10
commit
2724ec37f3
|
@ -148,9 +148,6 @@ public:
|
|||
/// default.
|
||||
static bool isDefaultMappingAsError(unsigned DiagID);
|
||||
|
||||
/// \brief Return true if the specified diagnostic is a Remark.
|
||||
static bool isRemark(unsigned DiagID);
|
||||
|
||||
/// \brief Determine whether the given built-in diagnostic ID is a Note.
|
||||
static bool isBuiltinNote(unsigned DiagID);
|
||||
|
||||
|
|
|
@ -353,11 +353,6 @@ bool DiagnosticIDs::isDefaultMappingAsError(unsigned DiagID) {
|
|||
return GetDefaultDiagMapping(DiagID).getSeverity() == diag::Severity::Error;
|
||||
}
|
||||
|
||||
bool DiagnosticIDs::isRemark(unsigned DiagID) {
|
||||
return DiagID < diag::DIAG_UPPER_LIMIT &&
|
||||
getBuiltinDiagClass(DiagID) == CLASS_REMARK;
|
||||
}
|
||||
|
||||
/// getDescription - Given a diagnostic ID, return a description of the
|
||||
/// issue.
|
||||
StringRef DiagnosticIDs::getDescription(unsigned DiagID) const {
|
||||
|
|
|
@ -82,7 +82,7 @@ static void printDiagnosticOptions(raw_ostream &OS,
|
|||
StringRef Opt = DiagnosticIDs::getWarningOptionForDiag(Info.getID());
|
||||
if (!Opt.empty()) {
|
||||
OS << (Started ? "," : " [")
|
||||
<< (DiagnosticIDs::isRemark(Info.getID()) ? "-R" : "-W") << Opt;
|
||||
<< (Level == DiagnosticsEngine::Remark ? "-R" : "-W") << Opt;
|
||||
StringRef OptValue = Info.getDiags()->getFlagNameValue();
|
||||
if (!OptValue.empty())
|
||||
OS << "=" << OptValue;
|
||||
|
|
Loading…
Reference in New Issue