///
/// \param Loc The source location that this change of diagnostic state should
/// take affect. It can be null if we are setting the latest state.
- void setDiagnosticMapping(diag::kind Diag, diag::Severity Map,
- SourceLocation Loc);
+ void setSeverity(diag::kind Diag, diag::Severity Map, SourceLocation Loc);
/// \brief Change an entire diagnostic group (e.g. "unknown-pragmas") to
/// have the specified mapping.
///
/// \param Loc The source location that this change of diagnostic state should
/// take affect. It can be null if we are setting the state from command-line.
- bool setDiagnosticGroupMapping(StringRef Group, diag::Severity Map,
- SourceLocation Loc = SourceLocation());
+ bool setSeverityForGroup(StringRef Group, diag::Severity Map,
+ SourceLocation Loc = SourceLocation());
/// \brief Set the warning-as-error flag for the given diagnostic group.
///
///
/// Mainly to be used by -Wno-everything to disable all warnings but allow
/// subsequent -W options to enable specific warnings.
- void setMappingForAllDiagnostics(diag::Severity Map,
- SourceLocation Loc = SourceLocation());
+ void setSeverityForAll(diag::Severity Map,
+ SourceLocation Loc = SourceLocation());
bool hasErrorOccurred() const { return ErrorOccurred; }
ARCMTMacroLocs);
pass.setNoFinalizeRemoval(NoFinalizeRemoval);
if (!NoNSAllocReallocError)
- Diags->setDiagnosticMapping(diag::warn_arcmt_nsalloc_realloc,
- diag::Severity::Error, SourceLocation());
+ Diags->setSeverity(diag::warn_arcmt_nsalloc_realloc, diag::Severity::Error,
+ SourceLocation());
for (unsigned i=0, e = transforms.size(); i != e; ++i)
transforms[i](pass);
return Pos;
}
-void DiagnosticsEngine::setDiagnosticMapping(diag::kind Diag,
- diag::Severity Map,
- SourceLocation L) {
+void DiagnosticsEngine::setSeverity(diag::kind Diag, diag::Severity Map,
+ SourceLocation L) {
assert(Diag < diag::DIAG_UPPER_LIMIT &&
"Can only map builtin diagnostics");
assert((Diags->isBuiltinWarningOrExtension(Diag) ||
FullSourceLoc(Loc, *SourceMgr)));
}
-bool DiagnosticsEngine::setDiagnosticGroupMapping(StringRef Group,
- diag::Severity Map,
- SourceLocation Loc) {
+bool DiagnosticsEngine::setSeverityForGroup(StringRef Group, diag::Severity Map,
+ SourceLocation Loc) {
// Get the diagnostics in this group.
SmallVector<diag::kind, 8> GroupDiags;
if (Diags->getDiagnosticsInGroup(Group, GroupDiags))
// Set the mapping.
for (unsigned i = 0, e = GroupDiags.size(); i != e; ++i)
- setDiagnosticMapping(GroupDiags[i], Map, Loc);
+ setSeverity(GroupDiags[i], Map, Loc);
return false;
}
// If we are enabling this feature, just set the diagnostic mappings to map to
// errors.
if (Enabled)
- return setDiagnosticGroupMapping(Group, diag::Severity::Error);
+ return setSeverityForGroup(Group, diag::Severity::Error);
// Otherwise, we want to set the diagnostic mapping's "no Werror" bit, and
// potentially downgrade anything already mapped to be a warning.
// If we are enabling this feature, just set the diagnostic mappings to map to
// fatal errors.
if (Enabled)
- return setDiagnosticGroupMapping(Group, diag::Severity::Fatal);
+ return setSeverityForGroup(Group, diag::Severity::Fatal);
// Otherwise, we want to set the diagnostic mapping's "no Werror" bit, and
// potentially downgrade anything already mapped to be an error.
return false;
}
-void DiagnosticsEngine::setMappingForAllDiagnostics(diag::Severity Map,
- SourceLocation Loc) {
+void DiagnosticsEngine::setSeverityForAll(diag::Severity Map,
+ SourceLocation Loc) {
// Get all the diagnostics.
SmallVector<diag::kind, 64> AllDiags;
Diags->getAllDiagnostics(AllDiags);
// Set the mapping.
for (unsigned i = 0, e = AllDiags.size(); i != e; ++i)
if (Diags->isBuiltinWarningOrExtension(AllDiags[i]))
- setDiagnosticMapping(AllDiags[i], Map, Loc);
+ setSeverity(AllDiags[i], Map, Loc);
}
void DiagnosticsEngine::Report(const StoredDiagnostic &storedDiag) {
Diags.setEnableAllWarnings(true);
} else {
Diags.setEnableAllWarnings(false);
- Diags.setMappingForAllDiagnostics(diag::Severity::Ignored);
+ Diags.setSeverityForAll(diag::Severity::Ignored);
}
}
continue;
EmitUnknownDiagWarning(Diags, isPositive ? "-W" : "-Wno-", Opt,
isPositive);
} else {
- Diags.setDiagnosticGroupMapping(Opt, Mapping);
+ Diags.setSeverityForGroup(Opt, Mapping);
}
}
}
return;
}
- if (PP.getDiagnostics().setDiagnosticGroupMapping(WarningName.substr(2), SV,
- DiagLoc))
+ if (PP.getDiagnostics().setSeverityForGroup(WarningName.substr(2), SV,
+ DiagLoc))
PP.Diag(StringLoc, diag::warn_pragma_diagnostic_unknown_warning)
<< WarningName;
else if (Callbacks)
FirstTok.getLocation()) !=
DiagnosticsEngine::Ignored) {
PP.Diag(FirstTok, diag::warn_pragma_omp_ignored);
- PP.getDiagnostics().setDiagnosticMapping(diag::warn_pragma_omp_ignored,
- diag::Severity::Ignored,
- SourceLocation());
+ PP.getDiagnostics().setSeverity(diag::warn_pragma_omp_ignored,
+ diag::Severity::Ignored, SourceLocation());
}
PP.DiscardUntilEndOfDirective();
}