diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-24 21:55:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-24 21:55:47 +0000 |
commit | 116170c3b11d825a1f1c99b32cc1c2721f4347f3 (patch) | |
tree | 86611fbcd6e78474499a282d47ae4bf382da0ce9 /utils | |
parent | 43e1f8e1e35a248ba631a1006f68297d8049d109 (diff) | |
download | external_llvm-116170c3b11d825a1f1c99b32cc1c2721f4347f3.zip external_llvm-116170c3b11d825a1f1c99b32cc1c2721f4347f3.tar.gz external_llvm-116170c3b11d825a1f1c99b32cc1c2721f4347f3.tar.bz2 |
diaggroup categories should take precedence over diag-specific groups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/ClangDiagnosticsEmitter.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index b2ddf93..75b6252 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -70,15 +70,16 @@ getCategoryFromDiagGroup(const Record *Group, /// lives in. static std::string getDiagnosticCategory(const Record *R, DiagGroupParentMap &DiagGroupParents) { - // If the diagnostic itself has a category, get it. - std::string CatName = R->getValueAsString("CategoryName"); - if (!CatName.empty()) return CatName; - - DefInit *Group = dynamic_cast<DefInit*>(R->getValueInit("Group")); - if (Group == 0) return ""; + // If the diagnostic is in a group, and that group has a category, use it. + if (DefInit *Group = dynamic_cast<DefInit*>(R->getValueInit("Group"))) { + // Check the diagnostic's diag group for a category. + std::string CatName = getCategoryFromDiagGroup(Group->getDef(), + DiagGroupParents); + if (!CatName.empty()) return CatName; + } - // Check the diagnostic's diag group for a category. - return getCategoryFromDiagGroup(Group->getDef(), DiagGroupParents); + // If the diagnostic itself has a category, get it. + return R->getValueAsString("CategoryName"); } namespace { |