Skip to content

Commit ce52ca1

Browse files
committed
Remove DiagGroups from notes, and add a TableGen assertion to catch them.
llvm-svn: 156192
1 parent e82ab6b commit ce52ca1

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,10 +1328,8 @@ def err_delegating_initializer_alone : Error<
13281328
def warn_delegating_ctor_cycle : Warning<
13291329
"constructor for %0 creates a delegation cycle">, DefaultError,
13301330
InGroup<DelegatingCtorCycles>;
1331-
def note_it_delegates_to : Note<
1332-
"it delegates to">, InGroup<DelegatingCtorCycles>;
1333-
def note_which_delegates_to : Note<
1334-
"which delegates to">, InGroup<DelegatingCtorCycles>;
1331+
def note_it_delegates_to : Note<"it delegates to">;
1332+
def note_which_delegates_to : Note<"which delegates to">;
13351333

13361334
// C++11 range-based for loop
13371335
def err_for_range_decl_must_be_var : Error<
@@ -1720,8 +1718,7 @@ def warn_lock_exclusive_and_shared : Warning<
17201718
"mutex '%0' is locked exclusively and shared in the same scope">,
17211719
InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
17221720
def note_lock_exclusive_and_shared : Note<
1723-
"the other lock of mutex '%0' is here">,
1724-
InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
1721+
"the other lock of mutex '%0' is here">;
17251722
def warn_variable_requires_lock : Warning<
17261723
"%select{reading|writing}2 variable '%0' requires locking "
17271724
"%select{'%1'|'%1' exclusively}2">,
@@ -5299,8 +5296,7 @@ def warn_empty_while_body : Warning<
52995296
def warn_empty_switch_body : Warning<
53005297
"switch statement has empty body">, InGroup<EmptyBody>;
53015298
def note_empty_body_on_separate_line : Note<
5302-
"put the semicolon on a separate line to silence this warning">,
5303-
InGroup<EmptyBody>;
5299+
"put the semicolon on a separate line to silence this warning">;
53045300

53055301
def err_va_start_used_in_non_variadic_function : Error<
53065302
"'va_start' used in function with fixed args">;

clang/utils/TableGen/ClangDiagnosticsEmitter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ static void groupDiagnostics(const std::vector<Record*> &Diags,
135135
const Record *R = Diags[i];
136136
DefInit *DI = dynamic_cast<DefInit*>(R->getValueInit("Group"));
137137
if (DI == 0) continue;
138+
assert(R->getValueAsDef("Class")->getName() != "CLASS_NOTE" &&
139+
"Note can't be in a DiagGroup");
138140
std::string GroupName = DI->getDef()->getValueAsString("GroupName");
139141
DiagsInGroup[GroupName].DiagsInGroup.push_back(R);
140142
}

0 commit comments

Comments
 (0)