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
/// 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);
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 {
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;