Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b7fedb8

Browse files
author
git apple-llvm automerger
committed
Merge commit '6c74fe9087fd' from llvm.org/main into next
2 parents 10b64f2 + 6c74fe9 commit b7fedb8

17 files changed

+85
-488
lines changed

clang/include/clang/Basic/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ macro(clang_diag_gen component)
1313
-gen-clang-diags-compat-ids -clang-component=${component}
1414
SOURCE Diagnostic.td
1515
TARGET ClangDiagnostic${component}CompatIDs)
16+
17+
clang_tablegen(Diagnostic${component}Interface.inc
18+
-gen-clang-diags-iface -clang-component=${component}
19+
SOURCE Diagnostic.td
20+
TARGET ClangDiagnostic${component}Interface)
1621
endmacro(clang_diag_gen)
1722

1823
clang_diag_gen(Analysis)

clang/include/clang/Basic/DiagnosticAST.h

+1-39
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICAST_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define ASTSTART
21-
#include "clang/Basic/DiagnosticASTKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_AST_DIAGNOSTICS
24-
};
25-
26-
#define DIAG_ENUM(ENUM_NAME) \
27-
namespace ENUM_NAME { \
28-
enum {
29-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
30-
#define DIAG_ENUM_END() \
31-
} \
32-
; \
33-
}
34-
#include "clang/Basic/DiagnosticASTEnums.inc"
35-
#undef DIAG_ENUM_END
36-
#undef DIAG_ENUM_ITEM
37-
#undef DIAG_ENUM
38-
} // end namespace diag
39-
40-
namespace diag_compat {
41-
#define DIAG_COMPAT_IDS_BEGIN() enum {
42-
#define DIAG_COMPAT_IDS_END() \
43-
} \
44-
;
45-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
46-
#include "clang/Basic/DiagnosticASTCompatIDs.inc"
47-
#undef DIAG_COMPAT_ID
48-
#undef DIAG_COMPAT_IDS_BEGIN
49-
#undef DIAG_COMPAT_IDS_END
50-
} // end namespace diag_compat
51-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticASTInterface.inc"
5214

5315
#endif // LLVM_CLANG_BASIC_DIAGNOSTICAST_H

clang/include/clang/Basic/DiagnosticAnalysis.h

+1-38
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICANALYSIS_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define ANALYSISSTART
21-
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_ANALYSIS_DIAGNOSTICS
24-
};
25-
#define DIAG_ENUM(ENUM_NAME) \
26-
namespace ENUM_NAME { \
27-
enum {
28-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
29-
#define DIAG_ENUM_END() \
30-
} \
31-
; \
32-
}
33-
#include "clang/Basic/DiagnosticAnalysisEnums.inc"
34-
#undef DIAG_ENUM_END
35-
#undef DIAG_ENUM_ITEM
36-
#undef DIAG_ENUM
37-
} // end namespace diag
38-
39-
namespace diag_compat {
40-
#define DIAG_COMPAT_IDS_BEGIN() enum {
41-
#define DIAG_COMPAT_IDS_END() \
42-
} \
43-
;
44-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
45-
#include "clang/Basic/DiagnosticAnalysisCompatIDs.inc"
46-
#undef DIAG_COMPAT_ID
47-
#undef DIAG_COMPAT_IDS_BEGIN
48-
#undef DIAG_COMPAT_IDS_END
49-
} // end namespace diag_compat
50-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticAnalysisInterface.inc"
5114

5215
#endif // LLVM_CLANG_BASIC_DIAGNOSTICANALYSIS_H

clang/include/clang/Basic/DiagnosticComment.h

+1-39
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICCOMMENT_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define COMMENTSTART
21-
#include "clang/Basic/DiagnosticCommentKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_COMMENT_DIAGNOSTICS
24-
};
25-
26-
#define DIAG_ENUM(ENUM_NAME) \
27-
namespace ENUM_NAME { \
28-
enum {
29-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
30-
#define DIAG_ENUM_END() \
31-
} \
32-
; \
33-
}
34-
#include "clang/Basic/DiagnosticCommentEnums.inc"
35-
#undef DIAG_ENUM_END
36-
#undef DIAG_ENUM_ITEM
37-
#undef DIAG_ENUM
38-
} // end namespace diag
39-
40-
namespace diag_compat {
41-
#define DIAG_COMPAT_IDS_BEGIN() enum {
42-
#define DIAG_COMPAT_IDS_END() \
43-
} \
44-
;
45-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
46-
#include "clang/Basic/DiagnosticCommentCompatIDs.inc"
47-
#undef DIAG_COMPAT_ID
48-
#undef DIAG_COMPAT_IDS_BEGIN
49-
#undef DIAG_COMPAT_IDS_END
50-
} // end namespace diag_compat
51-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticCommentInterface.inc"
5214

5315
#endif // LLVM_CLANG_BASIC_DIAGNOSTICCOMMENT_H

clang/include/clang/Basic/DiagnosticCrossTU.h

+1-39
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICCROSSTU_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define CROSSTUSTART
21-
#include "clang/Basic/DiagnosticCrossTUKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_CROSSTU_DIAGNOSTICS
24-
};
25-
26-
#define DIAG_ENUM(ENUM_NAME) \
27-
namespace ENUM_NAME { \
28-
enum {
29-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
30-
#define DIAG_ENUM_END() \
31-
} \
32-
; \
33-
}
34-
#include "clang/Basic/DiagnosticCrossTUEnums.inc"
35-
#undef DIAG_ENUM_END
36-
#undef DIAG_ENUM_ITEM
37-
#undef DIAG_ENUM
38-
} // end namespace diag
39-
40-
namespace diag_compat {
41-
#define DIAG_COMPAT_IDS_BEGIN() enum {
42-
#define DIAG_COMPAT_IDS_END() \
43-
} \
44-
;
45-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
46-
#include "clang/Basic/DiagnosticCrossTUCompatIDs.inc"
47-
#undef DIAG_COMPAT_ID
48-
#undef DIAG_COMPAT_IDS_BEGIN
49-
#undef DIAG_COMPAT_IDS_END
50-
} // end namespace diag_compat
51-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticCrossTUInterface.inc"
5214

5315
#endif // LLVM_CLANG_BASIC_DIAGNOSTICCROSSTU_H

clang/include/clang/Basic/DiagnosticDriver.h

+1-39
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICDRIVER_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define DRIVERSTART
21-
#include "clang/Basic/DiagnosticDriverKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_DRIVER_DIAGNOSTICS
24-
};
25-
26-
#define DIAG_ENUM(ENUM_NAME) \
27-
namespace ENUM_NAME { \
28-
enum {
29-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
30-
#define DIAG_ENUM_END() \
31-
} \
32-
; \
33-
}
34-
#include "clang/Basic/DiagnosticDriverEnums.inc"
35-
#undef DIAG_ENUM_END
36-
#undef DIAG_ENUM_ITEM
37-
#undef DIAG_ENUM
38-
} // end namespace diag
39-
40-
namespace diag_compat {
41-
#define DIAG_COMPAT_IDS_BEGIN() enum {
42-
#define DIAG_COMPAT_IDS_END() \
43-
} \
44-
;
45-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
46-
#include "clang/Basic/DiagnosticDriverCompatIDs.inc"
47-
#undef DIAG_COMPAT_ID
48-
#undef DIAG_COMPAT_IDS_BEGIN
49-
#undef DIAG_COMPAT_IDS_END
50-
} // end namespace diag_compat
51-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticDriverInterface.inc"
5214

5315
#endif // LLVM_CLANG_BASIC_DIAGNOSTICDRIVER_H

clang/include/clang/Basic/DiagnosticFrontend.h

+1-39
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICFRONTEND_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define FRONTENDSTART
21-
#include "clang/Basic/DiagnosticFrontendKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_FRONTEND_DIAGNOSTICS
24-
};
25-
26-
#define DIAG_ENUM(ENUM_NAME) \
27-
namespace ENUM_NAME { \
28-
enum {
29-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
30-
#define DIAG_ENUM_END() \
31-
} \
32-
; \
33-
}
34-
#include "clang/Basic/DiagnosticFrontendEnums.inc"
35-
#undef DIAG_ENUM_END
36-
#undef DIAG_ENUM_ITEM
37-
#undef DIAG_ENUM
38-
} // end namespace diag
39-
40-
namespace diag_compat {
41-
#define DIAG_COMPAT_IDS_BEGIN() enum {
42-
#define DIAG_COMPAT_IDS_END() \
43-
} \
44-
;
45-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
46-
#include "clang/Basic/DiagnosticFrontendCompatIDs.inc"
47-
#undef DIAG_COMPAT_ID
48-
#undef DIAG_COMPAT_IDS_BEGIN
49-
#undef DIAG_COMPAT_IDS_END
50-
} // end namespace diag_compat
51-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticFrontendInterface.inc"
5214

5315
#endif // LLVM_CLANG_BASIC_DIAGNOSTICFRONTEND_H

clang/include/clang/Basic/DiagnosticIDs.h

+5-23
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,6 @@ namespace clang {
7373
/// All of the diagnostics that can be emitted by the frontend.
7474
typedef unsigned kind;
7575

76-
// Get typedefs for common diagnostics.
77-
enum {
78-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, CATEGORY, \
79-
NOWERROR, SHOWINSYSHEADER, SHOWINSYSMACRO, DEFFERABLE) \
80-
ENUM,
81-
#define COMMONSTART
82-
#include "clang/Basic/DiagnosticCommonKinds.inc"
83-
NUM_BUILTIN_COMMON_DIAGNOSTICS
84-
#undef DIAG
85-
};
86-
8776
/// Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs
8877
/// to either Ignore (nothing), Remark (emit a remark), Warning
8978
/// (emit a warning) or Error (emit as an error). It allows clients to
@@ -105,20 +94,13 @@ namespace clang {
10594
Remark ///< A diagnostic that indicates normal progress through
10695
///< compilation.
10796
};
108-
}
97+
} // end namespace diag
98+
} // end namespace clang
10999

110-
namespace diag_compat {
111-
#define DIAG_COMPAT_IDS_BEGIN() enum {
112-
#define DIAG_COMPAT_IDS_END() \
113-
} \
114-
;
115-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
116-
#include "clang/Basic/DiagnosticCommonCompatIDs.inc"
117-
#undef DIAG_COMPAT_ID
118-
#undef DIAG_COMPAT_IDS_BEGIN
119-
#undef DIAG_COMPAT_IDS_END
120-
} // end namespace diag_compat
100+
// This has to be included *after* the DIAG_START_ enums above are defined.
101+
#include "clang/Basic/DiagnosticCommonInterface.inc"
121102

103+
namespace clang {
122104
class DiagnosticMapping {
123105
LLVM_PREFERRED_TYPE(diag::Severity)
124106
unsigned Severity : 3;

clang/include/clang/Basic/DiagnosticInstallAPI.h

+1-37
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICINSTALLAPI_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
namespace clang {
14-
namespace diag {
15-
enum {
16-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
17-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
18-
ENUM,
19-
#define INSTALLAPISTART
20-
#include "clang/Basic/DiagnosticInstallAPIKinds.inc"
21-
#undef DIAG
22-
NUM_BUILTIN_INSTALLAPI_DIAGNOSTICS
23-
};
13+
#include "clang/Basic/DiagnosticInstallAPIInterface.inc"
2414

25-
#define DIAG_ENUM(ENUM_NAME) \
26-
namespace ENUM_NAME { \
27-
enum {
28-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
29-
#define DIAG_ENUM_END() \
30-
} \
31-
; \
32-
}
33-
#include "clang/Basic/DiagnosticInstallAPIEnums.inc"
34-
#undef DIAG_ENUM_END
35-
#undef DIAG_ENUM_ITEM
36-
#undef DIAG_ENUM
37-
} // namespace diag
38-
39-
namespace diag_compat {
40-
#define DIAG_COMPAT_IDS_BEGIN() enum {
41-
#define DIAG_COMPAT_IDS_END() \
42-
} \
43-
;
44-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
45-
#include "clang/Basic/DiagnosticInstallAPICompatIDs.inc"
46-
#undef DIAG_COMPAT_ID
47-
#undef DIAG_COMPAT_IDS_BEGIN
48-
#undef DIAG_COMPAT_IDS_END
49-
} // end namespace diag_compat
50-
} // namespace clang
5115
#endif // LLVM_CLANG_BASIC_DIAGNOSTICINSTALLAPI_H

0 commit comments

Comments
 (0)