r210764 - DiagnosticsEngine: update severity setters to new terminology
Alp Toker
alp at nuanti.com
Thu Jun 12 04:13:53 PDT 2014
Author: alp
Date: Thu Jun 12 06:13:52 2014
New Revision: 210764
URL: http://llvm.org/viewvc/llvm-project?rev=210764&view=rev
Log:
DiagnosticsEngine: update severity setters to new terminology
Modified:
cfe/trunk/include/clang/Basic/Diagnostic.h
cfe/trunk/lib/ARCMigrate/ARCMT.cpp
cfe/trunk/lib/Basic/Diagnostic.cpp
cfe/trunk/lib/Basic/Warnings.cpp
cfe/trunk/lib/Lex/Pragma.cpp
cfe/trunk/lib/Parse/ParsePragma.cpp
Modified: cfe/trunk/include/clang/Basic/Diagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Diagnostic.h?rev=210764&r1=210763&r2=210764&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Diagnostic.h (original)
+++ cfe/trunk/include/clang/Basic/Diagnostic.h Thu Jun 12 06:13:52 2014
@@ -544,8 +544,7 @@ public:
///
/// \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.
@@ -555,8 +554,8 @@ public:
///
/// \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.
///
@@ -576,8 +575,8 @@ public:
///
/// 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; }
Modified: cfe/trunk/lib/ARCMigrate/ARCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ARCMT.cpp?rev=210764&r1=210763&r2=210764&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ARCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ARCMT.cpp Thu Jun 12 06:13:52 2014
@@ -312,8 +312,8 @@ bool arcmt::checkForManualIssues(Compile
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);
Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=210764&r1=210763&r2=210764&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Basic/Diagnostic.cpp Thu Jun 12 06:13:52 2014
@@ -160,9 +160,8 @@ DiagnosticsEngine::GetDiagStatePointForL
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) ||
@@ -229,9 +228,8 @@ void DiagnosticsEngine::setDiagnosticMap
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))
@@ -239,7 +237,7 @@ bool DiagnosticsEngine::setDiagnosticGro
// 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;
}
@@ -249,7 +247,7 @@ bool DiagnosticsEngine::setDiagnosticGro
// 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.
@@ -278,7 +276,7 @@ bool DiagnosticsEngine::setDiagnosticGro
// 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.
@@ -301,8 +299,8 @@ bool DiagnosticsEngine::setDiagnosticGro
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);
@@ -310,7 +308,7 @@ void DiagnosticsEngine::setMappingForAll
// 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) {
Modified: cfe/trunk/lib/Basic/Warnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Warnings.cpp?rev=210764&r1=210763&r2=210764&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Warnings.cpp (original)
+++ cfe/trunk/lib/Basic/Warnings.cpp Thu Jun 12 06:13:52 2014
@@ -125,7 +125,7 @@ void clang::ProcessWarningOptions(Diagno
Diags.setEnableAllWarnings(true);
} else {
Diags.setEnableAllWarnings(false);
- Diags.setMappingForAllDiagnostics(diag::Severity::Ignored);
+ Diags.setSeverityForAll(diag::Severity::Ignored);
}
}
continue;
@@ -194,7 +194,7 @@ void clang::ProcessWarningOptions(Diagno
EmitUnknownDiagWarning(Diags, isPositive ? "-W" : "-Wno-", Opt,
isPositive);
} else {
- Diags.setDiagnosticGroupMapping(Opt, Mapping);
+ Diags.setSeverityForGroup(Opt, Mapping);
}
}
}
Modified: cfe/trunk/lib/Lex/Pragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Pragma.cpp?rev=210764&r1=210763&r2=210764&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Pragma.cpp (original)
+++ cfe/trunk/lib/Lex/Pragma.cpp Thu Jun 12 06:13:52 2014
@@ -998,8 +998,8 @@ public:
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)
Modified: cfe/trunk/lib/Parse/ParsePragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParsePragma.cpp?rev=210764&r1=210763&r2=210764&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParsePragma.cpp (original)
+++ cfe/trunk/lib/Parse/ParsePragma.cpp Thu Jun 12 06:13:52 2014
@@ -1215,9 +1215,8 @@ PragmaNoOpenMPHandler::HandlePragma(Prep
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();
}
More information about the cfe-commits
mailing list