mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
diaggroup categories should take precedence over diag-specific groups.
llvm-svn: 104567
This commit is contained in:
parent
e3f6ea45b2
commit
6ea2f4d4cc
@ -70,15 +70,16 @@ getCategoryFromDiagGroup(const Record *Group,
|
||||
/// lives in.
|
||||
static std::string getDiagnosticCategory(const Record *R,
|
||||
DiagGroupParentMap &DiagGroupParents) {
|
||||
// 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;
|
||||
}
|
||||
|
||||
// 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 "";
|
||||
|
||||
// Check the diagnostic's diag group for a category.
|
||||
return getCategoryFromDiagGroup(Group->getDef(), DiagGroupParents);
|
||||
return R->getValueAsString("CategoryName");
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
Loading…
x
Reference in New Issue
Block a user