summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Diagnostic.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-12 10:15:20 +0000
committerAlp Toker <alp@nuanti.com>2014-06-12 10:15:20 +0000
commit46df1c0db8a3265009f5b315247b657708883fe8 (patch)
treeb8c65f5bf61b4484ce3184f34265c0ec8815ea63 /clang/lib/Basic/Diagnostic.cpp
parent789ba735703c70c928b8753b80280eecb374050a (diff)
downloadbcm5719-llvm-46df1c0db8a3265009f5b315247b657708883fe8.tar.gz
bcm5719-llvm-46df1c0db8a3265009f5b315247b657708883fe8.zip
Complete the switch from mappings to declarative diagnostic severities
This begins to address cognitive dissonance caused by treating the Note diagnostic level as a severity in the diagnostic engine. No change in functionality. llvm-svn: 210758
Diffstat (limited to 'clang/lib/Basic/Diagnostic.cpp')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 97299611f0d..98826882894 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -166,7 +166,7 @@ void DiagnosticsEngine::setDiagnosticMapping(diag::kind Diag,
assert(Diag < diag::DIAG_UPPER_LIMIT &&
"Can only map builtin diagnostics");
assert((Diags->isBuiltinWarningOrExtension(Diag) ||
- (Map == diag::MAP_FATAL || Map == diag::MAP_ERROR)) &&
+ (Map == diag::Severity::Fatal || Map == diag::Severity::Error)) &&
"Cannot map errors into warnings!");
assert(!DiagStatePoints.empty());
assert((L.isInvalid() || SourceMgr) && "No SourceMgr for valid location");
@@ -174,10 +174,10 @@ void DiagnosticsEngine::setDiagnosticMapping(diag::kind Diag,
FullSourceLoc Loc = SourceMgr? FullSourceLoc(L, *SourceMgr) : FullSourceLoc();
FullSourceLoc LastStateChangePos = DiagStatePoints.back().Loc;
// Don't allow a mapping to a warning override an error/fatal mapping.
- if (Map == diag::MAP_WARNING) {
+ if (Map == diag::Severity::Warning) {
DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(Diag);
- if (Info.getSeverity() == diag::MAP_ERROR ||
- Info.getSeverity() == diag::MAP_FATAL)
+ if (Info.getSeverity() == diag::Severity::Error ||
+ Info.getSeverity() == diag::Severity::Fatal)
Map = Info.getSeverity();
}
DiagnosticMapping Mapping = makeUserMapping(Map, L);
@@ -249,7 +249,7 @@ bool DiagnosticsEngine::setDiagnosticGroupWarningAsError(StringRef Group,
// If we are enabling this feature, just set the diagnostic mappings to map to
// errors.
if (Enabled)
- return setDiagnosticGroupMapping(Group, diag::MAP_ERROR);
+ return setDiagnosticGroupMapping(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.
@@ -263,9 +263,9 @@ bool DiagnosticsEngine::setDiagnosticGroupWarningAsError(StringRef Group,
for (unsigned i = 0, e = GroupDiags.size(); i != e; ++i) {
DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(GroupDiags[i]);
- if (Info.getSeverity() == diag::MAP_ERROR ||
- Info.getSeverity() == diag::MAP_FATAL)
- Info.setSeverity(diag::MAP_WARNING);
+ if (Info.getSeverity() == diag::Severity::Error ||
+ Info.getSeverity() == diag::Severity::Fatal)
+ Info.setSeverity(diag::Severity::Warning);
Info.setNoWarningAsError(true);
}
@@ -278,7 +278,7 @@ bool DiagnosticsEngine::setDiagnosticGroupErrorAsFatal(StringRef Group,
// If we are enabling this feature, just set the diagnostic mappings to map to
// fatal errors.
if (Enabled)
- return setDiagnosticGroupMapping(Group, diag::MAP_FATAL);
+ return setDiagnosticGroupMapping(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.
@@ -292,8 +292,8 @@ bool DiagnosticsEngine::setDiagnosticGroupErrorAsFatal(StringRef Group,
for (unsigned i = 0, e = GroupDiags.size(); i != e; ++i) {
DiagnosticMapping &Info = GetCurDiagState()->getOrAddMapping(GroupDiags[i]);
- if (Info.getSeverity() == diag::MAP_FATAL)
- Info.setSeverity(diag::MAP_ERROR);
+ if (Info.getSeverity() == diag::Severity::Fatal)
+ Info.setSeverity(diag::Severity::Error);
Info.setNoErrorAsFatal(true);
}
OpenPOWER on IntegriCloud