summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/DiagnosticIDs.h
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-10 09:31:37 +0000
committerAlp Toker <alp@nuanti.com>2014-06-10 09:31:37 +0000
commite451a7e7601d25bcad758bc8efd1cdeb6579254b (patch)
treecd59171f24cfc8bb5b68913b4ba38781ff408484 /include/clang/Basic/DiagnosticIDs.h
parent5328ab0000298a379cf14b584e7d8be485d12363 (diff)
Improve diagnostic mapping terminology
Diagnostic mappings are used to calculate the final severity of diagnostic instances. Detangle the implementation to reflect the terminology used in documentation and bindings. No change in functionality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210518 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticIDs.h')
-rw-r--r--include/clang/Basic/DiagnosticIDs.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h
index 3627d1f975..9f0a03be83 100644
--- a/include/clang/Basic/DiagnosticIDs.h
+++ b/include/clang/Basic/DiagnosticIDs.h
@@ -60,28 +60,28 @@ namespace clang {
/// (emit a warning), MAP_ERROR (emit as an error). It allows clients to
/// map errors to MAP_ERROR/MAP_DEFAULT or MAP_FATAL (stop emitting
/// diagnostics after this one).
- enum Mapping {
+ enum Severity {
// NOTE: 0 means "uncomputed".
- MAP_IGNORE = 1, ///< Map this diagnostic to nothing, ignore it.
- MAP_REMARK = 2, ///< Map this diagnostic to a remark.
- MAP_WARNING = 3, ///< Map this diagnostic to a warning.
- MAP_ERROR = 4, ///< Map this diagnostic to an error.
- MAP_FATAL = 5 ///< Map this diagnostic to a fatal error.
+ MAP_IGNORE = 1, ///< Map this diagnostic to nothing, ignore it.
+ MAP_REMARK = 2, ///< Map this diagnostic to a remark.
+ MAP_WARNING = 3, ///< Map this diagnostic to a warning.
+ MAP_ERROR = 4, ///< Map this diagnostic to an error.
+ MAP_FATAL = 5 ///< Map this diagnostic to a fatal error.
};
}
-class DiagnosticMappingInfo {
- unsigned Mapping : 3;
+class DiagnosticMapping {
+ unsigned Severity : 3;
unsigned IsUser : 1;
unsigned IsPragma : 1;
unsigned HasNoWarningAsError : 1;
unsigned HasNoErrorAsFatal : 1;
public:
- static DiagnosticMappingInfo Make(diag::Mapping Mapping, bool IsUser,
- bool IsPragma) {
- DiagnosticMappingInfo Result;
- Result.Mapping = Mapping;
+ static DiagnosticMapping Make(diag::Severity Severity, bool IsUser,
+ bool IsPragma) {
+ DiagnosticMapping Result;
+ Result.Severity = Severity;
Result.IsUser = IsUser;
Result.IsPragma = IsPragma;
Result.HasNoWarningAsError = 0;
@@ -89,8 +89,8 @@ public:
return Result;
}
- diag::Mapping getMapping() const { return diag::Mapping(Mapping); }
- void setMapping(diag::Mapping Value) { Mapping = Value; }
+ diag::Severity getSeverity() const { return diag::Severity(Severity); }
+ void setSeverity(diag::Severity Value) { Severity = Value; }
bool isUser() const { return IsUser; }
bool isPragma() const { return IsPragma; }