diff options
author | Alp Toker <alp@nuanti.com> | 2014-06-12 10:15:20 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-06-12 10:15:20 +0000 |
commit | 18a9b6654286356870c6c336ad9fdc6ad7599dbe (patch) | |
tree | a5233ce6ebfd92720529dc812124197fabc124e9 /utils | |
parent | 1408b3372ea1b0b84c31103a4a2f54391cc73138 (diff) | |
download | clang-18a9b6654286356870c6c336ad9fdc6ad7599dbe.tar.gz clang-18a9b6654286356870c6c336ad9fdc6ad7599dbe.tar.bz2 clang-18a9b6654286356870c6c336ad9fdc6ad7599dbe.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/ClangDiagnosticsEmitter.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index b4cc70669e..76b484e783 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -358,8 +358,9 @@ bool InferPedantic::isExtension(const Record *Diag) { } bool InferPedantic::isOffByDefault(const Record *Diag) { - const std::string &DefMap = Diag->getValueAsDef("DefaultMapping")->getName(); - return DefMap == "MAP_IGNORE"; + const std::string &DefSeverity = + Diag->getValueAsDef("DefaultSeverity")->getValueAsString("Name"); + return DefSeverity == "Ignored"; } bool InferPedantic::groupInPedantic(const Record *Group, bool increment) { @@ -538,7 +539,8 @@ void EmitClangDiagsDefs(RecordKeeper &Records, raw_ostream &OS, OS << "DIAG(" << R.getName() << ", "; OS << R.getValueAsDef("Class")->getName(); - OS << ", diag::" << R.getValueAsDef("DefaultMapping")->getName(); + OS << ", (unsigned)diag::Severity::" + << R.getValueAsDef("DefaultSeverity")->getValueAsString("Name"); // Description string. OS << ", \""; |