]> granicus.if.org Git - clang/commitdiff
Remove DiagGroups from notes, and add a TableGen assertion to catch them.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 4 May 2012 19:05:50 +0000 (19:05 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 4 May 2012 19:05:50 +0000 (19:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156192 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
utils/TableGen/ClangDiagnosticsEmitter.cpp

index f1bee6a676cb224b00259961022d38cdc3fbd83c..4c8a133e05392858533ff759d46950ebc9c2134f 100644 (file)
@@ -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<DelegatingCtorCycles>;
-def note_it_delegates_to : Note<
-  "it delegates to">, InGroup<DelegatingCtorCycles>;
-def note_which_delegates_to : Note<
-  "which delegates to">, InGroup<DelegatingCtorCycles>;
+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<ThreadSafetyAnalysis>, DefaultIgnore;
 def note_lock_exclusive_and_shared : Note<
-  "the other lock of mutex '%0' is here">,
-  InGroup<ThreadSafetyAnalysis>, 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<EmptyBody>;
 def note_empty_body_on_separate_line : Note<
-  "put the semicolon on a separate line to silence this warning">,
-  InGroup<EmptyBody>;
+  "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">;
index 8a49619c725e63c71c76cbb92f0e3422a14e0e7f..520ec0a2c5483276345f7054f9369afe486ba35f 100644 (file)
@@ -135,6 +135,8 @@ static void groupDiagnostics(const std::vector<Record*> &Diags,
     const Record *R = Diags[i];
     DefInit *DI = dynamic_cast<DefInit*>(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);
   }