From: Richard Smith Date: Fri, 4 May 2012 19:05:50 +0000 (+0000) Subject: Remove DiagGroups from notes, and add a TableGen assertion to catch them. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46484770fe264fba24f7a9f608a3b7c3342690aa;p=clang Remove DiagGroups from notes, and add a TableGen assertion to catch them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156192 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index f1bee6a676..4c8a133e05 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1328,10 +1328,8 @@ def err_delegating_initializer_alone : Error< def warn_delegating_ctor_cycle : Warning< "constructor for %0 creates a delegation cycle">, DefaultError, InGroup; -def note_it_delegates_to : Note< - "it delegates to">, InGroup; -def note_which_delegates_to : Note< - "which delegates to">, InGroup; +def note_it_delegates_to : Note<"it delegates to">; +def note_which_delegates_to : Note<"which delegates to">; // C++11 range-based for loop def err_for_range_decl_must_be_var : Error< @@ -1720,8 +1718,7 @@ def warn_lock_exclusive_and_shared : Warning< "mutex '%0' is locked exclusively and shared in the same scope">, InGroup, DefaultIgnore; def note_lock_exclusive_and_shared : Note< - "the other lock of mutex '%0' is here">, - InGroup, DefaultIgnore; + "the other lock of mutex '%0' is here">; def warn_variable_requires_lock : Warning< "%select{reading|writing}2 variable '%0' requires locking " "%select{'%1'|'%1' exclusively}2">, @@ -5299,8 +5296,7 @@ def warn_empty_while_body : Warning< def warn_empty_switch_body : Warning< "switch statement has empty body">, InGroup; def note_empty_body_on_separate_line : Note< - "put the semicolon on a separate line to silence this warning">, - InGroup; + "put the semicolon on a separate line to silence this warning">; def err_va_start_used_in_non_variadic_function : Error< "'va_start' used in function with fixed args">; diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index 8a49619c72..520ec0a2c5 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -135,6 +135,8 @@ static void groupDiagnostics(const std::vector &Diags, const Record *R = Diags[i]; DefInit *DI = dynamic_cast(R->getValueInit("Group")); if (DI == 0) continue; + assert(R->getValueAsDef("Class")->getName() != "CLASS_NOTE" && + "Note can't be in a DiagGroup"); std::string GroupName = DI->getDef()->getValueAsString("GroupName"); DiagsInGroup[GroupName].DiagsInGroup.push_back(R); }