Lines Matching defs:DIAG
69 #define DIAG(ENUM, CLASS, DEFAULT_SEVERITY, DESC, GROUP, SFINAE, NOWERROR, \
72 diag::ENUM, DEFAULT_SEVERITY, CLASS, DiagnosticIDs::SFINAE, NOWERROR, \
86 #undef DIAG
100 "Diag ID conflict, the enums at the start of clang::diag (in "
104 "Improperly sorted diag info");
110 // Out of bounds diag. Can't be in the table.
111 using namespace diag;
148 // If the diag id doesn't match we found a different diag, abort. This can
158 diag::Severity::Fatal, /*IsUser=*/false, /*IsPragma=*/false);
161 Info.setSeverity((diag::Severity)StaticInfo->DefaultSeverity);
164 assert(Info.getSeverity() == diag::Severity::Warning &&
197 DiagnosticsEngine::DiagState::getOrAddMapping(diag::kind Diag) {
199 DiagMap.insert(std::make_pair(Diag, DiagnosticMapping()));
203 Result.first->second = GetDefaultDiagMapping(Diag);
252 namespace diag {
290 } // end diag namespace
312 CustomDiagInfo = new diag::CustomDiagInfo();
322 return DiagID < diag::DIAG_UPPER_LIMIT &&
329 return DiagID < diag::DIAG_UPPER_LIMIT &&
340 if (DiagID >= diag::DIAG_UPPER_LIMIT ||
345 GetDefaultDiagMapping(DiagID).getSeverity() != diag::Severity::Ignored;
350 if (DiagID >= diag::DIAG_UPPER_LIMIT)
353 return GetDefaultDiagMapping(DiagID).getSeverity() == diag::Severity::Error;
364 static DiagnosticIDs::Level toLevel(diag::Severity SV) {
366 case diag::Severity::Ignored:
368 case diag::Severity::Remark:
370 case diag::Severity::Warning:
372 case diag::Severity::Error:
374 case diag::Severity::Fatal:
385 const DiagnosticsEngine &Diag) const {
387 if (DiagID >= diag::DIAG_UPPER_LIMIT)
392 return toLevel(getDiagnosticSeverity(DiagID, Loc, Diag));
401 diag::Severity
403 const DiagnosticsEngine &Diag) const {
408 diag::Severity Result = diag::Severity::Fatal;
411 Pos = Diag.GetDiagStatePointForLoc(Loc);
415 DiagnosticMapping &Mapping = State->getOrAddMapping((diag::kind)DiagID);
418 if (Mapping.getSeverity() != diag::Severity())
422 if (Diag.EnableAllWarnings && Result == diag::Severity::Ignored &&
424 Result = diag::Severity::Warning;
429 if (Result == diag::Severity::Warning &&
431 Result = diag::Severity::Remark;
438 if (Diag.AllExtensionsSilenced && IsExtensionDiag && !EnabledByDefault)
439 return diag::Severity::Ignored;
444 Result = std::max(Result, Diag.ExtBehavior);
447 if (Result == diag::Severity::Ignored)
452 if (Result == diag::Severity::Warning && Diag.IgnoreAllWarnings)
453 return diag::Severity::Ignored;
456 if (Result == diag::Severity::Warning) {
457 if (Diag
458 Result = diag::Severity::Error;
463 if (Result == diag::Severity::Error) {
464 if (Diag.ErrorsAsFatal && !Mapping.hasNoErrorAsFatal())
465 Result = diag::Severity::Fatal;
475 if (Diag.SuppressSystemWarnings && !ShowInSystemHeader && Loc.isValid() &&
476 Diag.getSourceManager().isInSystemHeader(
477 Diag.getSourceManager().getExpansionLoc(Loc)))
478 return diag::Severity::Ignored;
523 SmallVectorImpl<diag::kind> &Diags) {
537 SmallVectorImpl<diag::kind> &Diags) const {
550 SmallVectorImpl<diag::kind> &Diags) const {
580 bool DiagnosticIDs::ProcessDiag(DiagnosticsEngine &Diag) const {
581 Diagnostic Info(&Diag);
583 if (Diag.SuppressAllDiagnostics)
586 assert(Diag.getClient() && "DiagnosticClient not set!");
591 = getDiagnosticLevel(DiagID, Info.getLocation(), Diag);
598 if (Diag.LastDiagLevel == DiagnosticIDs::Fatal)
599 Diag.FatalErrorOccurred = true;
601 Diag.LastDiagLevel = DiagLevel;
606 ++Diag.TrapNumErrorsOccurred;
608 ++Diag.TrapNumUnrecoverableErrorsOccurred;
613 if (Diag.FatalErrorOccurred) {
615 Diag.Client->IncludeInDiagnosticCounts()) {
616 ++Diag.NumErrors;
617 ++Diag.NumErrorsSuppressed;
627 Diag.LastDiagLevel == DiagnosticIDs::Ignored))
632 Diag.UnrecoverableErrorOccurred = true;
636 Diag.UncompilableErrorOccurred = true;
638 Diag.ErrorOccurred = true;
639 if (Diag.Client->IncludeInDiagnosticCounts()) {
640 ++Diag.NumErrors;
645 if (Diag.ErrorLimit && Diag.NumErrors > Diag.ErrorLimit &&
647 Diag.SetDelayedDiagnostic(diag::fatal_too_many_errors);
653 EmitDiag(Diag, DiagLevel);
657 void DiagnosticIDs::EmitDiag(DiagnosticsEngine &Diag, Level DiagLevel) const {
658 Diagnostic Info(&Diag);
661 Diag.Client->HandleDiagnostic((DiagnosticsEngine::Level)DiagLevel, Info);
662 if (Diag.Client->IncludeInDiagnosticCounts()) {
664 ++Diag.NumWarnings;
667 Diag.CurDiagID = ~0U;
671 if (DiagID >= diag::DIAG_UPPER_LIMIT) {
680 if (DiagID == diag::err_unavailable ||
681 DiagID == diag::err_unavailable_message)