Skip to content

Commit 81743f8

Browse files
committed
[diagtool] Make the BuiltinDiagnosticsByID table sorted
Renamed DiagnosticIDs.inc to AllDiagnosticKinds.inc Minor changes in comments.
1 parent 4cedc90 commit 81743f8

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

clang/include/clang/Basic/DiagnosticIDs.inc renamed to clang/include/clang/Basic/AllDiagnosticKinds.inc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- DiagnosticIDs.inc --------------------------------------*- C++ -*-===//
1+
//===--- AllDiagnosticKinds.inc----------------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -7,12 +7,14 @@
77
//===----------------------------------------------------------------------===//
88
///
99
/// \file
10-
/// Defines the Diagnostic IDs in ID sorted order.
10+
/// Defines the Diagnostic IDs in ID sorted order. The order is dictated by
11+
/// the enum in DiagnosticIDs.h#L49-L65.
1112
///
1213
//===----------------------------------------------------------------------===//
1314

1415
// Turn off clang-format, as the order of the includes are important to make
15-
// sure the table is sorted.
16+
// sure tables based on Diagnostic IDs are partitioned/sorted based on
17+
// DiagID.
1618

1719
// clang-format off
1820
#include "clang/Basic/DiagnosticCommonKinds.inc"

clang/lib/Basic/DiagnosticIDs.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ struct StaticDiagInfoDescriptionStringTable {
3737
#define DIAG(ENUM, CLASS, DEFAULT_SEVERITY, DESC, GROUP, SFINAE, NOWERROR, \
3838
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
3939
char ENUM##_desc[sizeof(DESC)];
40-
#include "clang/Basic/DiagnosticIDs.inc"
40+
#include "clang/Basic/AllDiagnosticKinds.inc"
4141
#undef DIAG
4242
};
4343

4444
const StaticDiagInfoDescriptionStringTable StaticDiagInfoDescriptions = {
4545
#define DIAG(ENUM, CLASS, DEFAULT_SEVERITY, DESC, GROUP, SFINAE, NOWERROR, \
4646
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
4747
DESC,
48-
#include "clang/Basic/DiagnosticIDs.inc"
48+
#include "clang/Basic/AllDiagnosticKinds.inc"
4949
#undef DIAG
5050
};
5151

@@ -57,7 +57,7 @@ const uint32_t StaticDiagInfoDescriptionOffsets[] = {
5757
#define DIAG(ENUM, CLASS, DEFAULT_SEVERITY, DESC, GROUP, SFINAE, NOWERROR, \
5858
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
5959
offsetof(StaticDiagInfoDescriptionStringTable, ENUM##_desc),
60-
#include "clang/Basic/DiagnosticIDs.inc"
60+
#include "clang/Basic/AllDiagnosticKinds.inc"
6161
#undef DIAG
6262
};
6363

clang/tools/diagtool/DiagnosticNames.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static const DiagnosticRecord BuiltinDiagnosticsByID[] = {
2929
#define DIAG(ENUM, CLASS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
3030
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFER, CATEGORY) \
3131
{#ENUM, diag::ENUM, STR_SIZE(#ENUM, uint8_t)},
32-
#include "clang/Basic/DiagnosticIDs.inc"
32+
#include "clang/Basic/AllDiagnosticKinds.inc"
3333
#undef DIAG
3434
};
3535

0 commit comments

Comments
 (0)