Skip to content

Commit d076608

Browse files
committed
Move diagnostic enums into Basic.
Move enums from */*Diagnostic.h to Basic/Diagnostic*.h. Basic/AllDiagnostics.h needs all the enums and moving the sources to Basic prevents a Basic->*->Basic dependency loop. This also allows each Basic/Diagnostics*Kinds.td to have a header at Basic/Diagnostic*.h (except for Common). The old headers are kept in place since other packages are still using them. llvm-svn: 348685
1 parent e1f9665 commit d076608

23 files changed

+342
-166
lines changed

clang/include/clang/AST/ASTDiagnostic.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,9 @@
1111
#define LLVM_CLANG_AST_ASTDIAGNOSTIC_H
1212

1313
#include "clang/Basic/Diagnostic.h"
14+
#include "clang/Basic/DiagnosticAST.h"
1415

1516
namespace clang {
16-
namespace diag {
17-
enum {
18-
#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\
19-
SFINAE,NOWERROR,SHOWINSYSHEADER,CATEGORY) ENUM,
20-
#define ASTSTART
21-
#include "clang/Basic/DiagnosticASTKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_AST_DIAGNOSTICS
24-
};
25-
} // end namespace diag
26-
2717
/// DiagnosticsEngine argument formatting function for diagnostics that
2818
/// involve AST nodes.
2919
///

clang/include/clang/AST/CommentDiagnostic.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,7 @@
1010
#ifndef LLVM_CLANG_AST_COMMENTDIAGNOSTIC_H
1111
#define LLVM_CLANG_AST_COMMENTDIAGNOSTIC_H
1212

13-
#include "clang/Basic/Diagnostic.h"
14-
15-
namespace clang {
16-
namespace diag {
17-
enum {
18-
#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\
19-
SFINAE,NOWERROR,SHOWINSYSHEADER,CATEGORY) ENUM,
20-
#define COMMENTSTART
21-
#include "clang/Basic/DiagnosticCommentKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_COMMENT_DIAGNOSTICS
24-
};
25-
} // end namespace diag
26-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticComment.h"
2714

2815
#endif
2916

clang/include/clang/Analysis/AnalysisDiagnostic.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,6 @@
1010
#ifndef LLVM_CLANG_ANALYSIS_ANALYSISDIAGNOSTIC_H
1111
#define LLVM_CLANG_ANALYSIS_ANALYSISDIAGNOSTIC_H
1212

13-
#include "clang/Basic/Diagnostic.h"
14-
15-
namespace clang {
16-
namespace diag {
17-
enum {
18-
#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\
19-
SFINAE,NOWERROR,SHOWINSYSHEADER,CATEGORY) ENUM,
20-
#define ANALYSISSTART
21-
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_ANALYSIS_DIAGNOSTICS
24-
};
25-
} // end namespace diag
26-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticAnalysis.h"
2714

2815
#endif

clang/include/clang/Basic/AllDiagnostics.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
#ifndef LLVM_CLANG_BASIC_ALLDIAGNOSTICS_H
1616
#define LLVM_CLANG_BASIC_ALLDIAGNOSTICS_H
1717

18-
#include "clang/AST/ASTDiagnostic.h"
19-
#include "clang/AST/CommentDiagnostic.h"
20-
#include "clang/Analysis/AnalysisDiagnostic.h"
21-
#include "clang/CrossTU/CrossTUDiagnostic.h"
22-
#include "clang/Driver/DriverDiagnostic.h"
23-
#include "clang/Frontend/FrontendDiagnostic.h"
24-
#include "clang/Lex/LexDiagnostic.h"
25-
#include "clang/Parse/ParseDiagnostic.h"
26-
#include "clang/Sema/SemaDiagnostic.h"
27-
#include "clang/Serialization/SerializationDiagnostic.h"
28-
#include "clang/Tooling/Refactoring/RefactoringDiagnostic.h"
18+
#include "clang/Basic/DiagnosticAST.h"
19+
#include "clang/Basic/DiagnosticAnalysis.h"
20+
#include "clang/Basic/DiagnosticComment.h"
21+
#include "clang/Basic/DiagnosticCrossTU.h"
22+
#include "clang/Basic/DiagnosticDriver.h"
23+
#include "clang/Basic/DiagnosticFrontend.h"
24+
#include "clang/Basic/DiagnosticLex.h"
25+
#include "clang/Basic/DiagnosticParse.h"
26+
#include "clang/Basic/DiagnosticSema.h"
27+
#include "clang/Basic/DiagnosticSerialization.h"
28+
#include "clang/Basic/DiagnosticRefactoring.h"
2929

3030
namespace clang {
3131
template <size_t SizeOfStr, typename FieldType>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- DiagnosticAST.h - Diagnostics for the AST library ------*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_CLANG_BASIC_DIAGNOSTICAST_H
11+
#define LLVM_CLANG_BASIC_DIAGNOSTICAST_H
12+
13+
#include "clang/Basic/Diagnostic.h"
14+
15+
namespace clang {
16+
namespace diag {
17+
enum {
18+
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
19+
SHOWINSYSHEADER, CATEGORY) \
20+
ENUM,
21+
#define ASTSTART
22+
#include "clang/Basic/DiagnosticASTKinds.inc"
23+
#undef DIAG
24+
NUM_BUILTIN_AST_DIAGNOSTICS
25+
};
26+
} // end namespace diag
27+
} // end namespace clang
28+
29+
#endif // LLVM_CLANG_BASIC_DIAGNOSTICAST_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- DiagnosticAnalysis.h - Diagnostics for libanalysis -----*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_CLANG_BASIC_DIAGNOSTICANALYSIS_H
11+
#define LLVM_CLANG_BASIC_DIAGNOSTICANALYSIS_H
12+
13+
#include "clang/Basic/Diagnostic.h"
14+
15+
namespace clang {
16+
namespace diag {
17+
enum {
18+
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
19+
SHOWINSYSHEADER, CATEGORY) \
20+
ENUM,
21+
#define ANALYSISSTART
22+
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
23+
#undef DIAG
24+
NUM_BUILTIN_ANALYSIS_DIAGNOSTICS
25+
};
26+
} // end namespace diag
27+
} // end namespace clang
28+
29+
#endif // LLVM_CLANG_BASIC_DIAGNOSTICANALYSIS_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- DiagnosticComment.h - Diagnostics for the AST library --*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_CLANG_BASIC_DIAGNOSTICCOMMENT_H
11+
#define LLVM_CLANG_BASIC_DIAGNOSTICCOMMENT_H
12+
13+
#include "clang/Basic/Diagnostic.h"
14+
15+
namespace clang {
16+
namespace diag {
17+
enum {
18+
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
19+
SHOWINSYSHEADER, CATEGORY) \
20+
ENUM,
21+
#define COMMENTSTART
22+
#include "clang/Basic/DiagnosticCommentKinds.inc"
23+
#undef DIAG
24+
NUM_BUILTIN_COMMENT_DIAGNOSTICS
25+
};
26+
} // end namespace diag
27+
} // end namespace clang
28+
29+
#endif // LLVM_CLANG_BASIC_DIAGNOSTICCOMMENT_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- DiagnosticCrossTU.h - Diagnostics for Cross TU ---------*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_CLANG_BASIC_DIAGNOSTICCROSSTU_H
11+
#define LLVM_CLANG_BASIC_DIAGNOSTICCROSSTU_H
12+
13+
#include "clang/Basic/Diagnostic.h"
14+
15+
namespace clang {
16+
namespace diag {
17+
enum {
18+
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
19+
SHOWINSYSHEADER, CATEGORY) \
20+
ENUM,
21+
#define CROSSTUSTART
22+
#include "clang/Basic/DiagnosticCrossTUKinds.inc"
23+
#undef DIAG
24+
NUM_BUILTIN_CROSSTU_DIAGNOSTICS
25+
};
26+
} // end namespace diag
27+
} // end namespace clang
28+
29+
#endif // LLVM_CLANG_BASIC_DIAGNOSTICCROSSTU_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- DiagnosticDriver.h - Diagnostics for libdriver ---------*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_CLANG_BASIC_DIAGNOSTICDRIVER_H
11+
#define LLVM_CLANG_BASIC_DIAGNOSTICDRIVER_H
12+
13+
#include "clang/Basic/Diagnostic.h"
14+
15+
namespace clang {
16+
namespace diag {
17+
enum {
18+
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
19+
SHOWINSYSHEADER, CATEGORY) \
20+
ENUM,
21+
#define DRIVERSTART
22+
#include "clang/Basic/DiagnosticDriverKinds.inc"
23+
#undef DIAG
24+
NUM_BUILTIN_DRIVER_DIAGNOSTICS
25+
};
26+
} // end namespace diag
27+
} // end namespace clang
28+
29+
#endif // LLVM_CLANG_BASIC_DIAGNOSTICDRIVER_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- DiagnosticFrontend.h - Diagnostics for frontend --------*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_CLANG_BASIC_DIAGNOSTICFRONTEND_H
11+
#define LLVM_CLANG_BASIC_DIAGNOSTICFRONTEND_H
12+
13+
#include "clang/Basic/Diagnostic.h"
14+
15+
namespace clang {
16+
namespace diag {
17+
enum {
18+
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
19+
SHOWINSYSHEADER, CATEGORY) \
20+
ENUM,
21+
#define FRONTENDSTART
22+
#include "clang/Basic/DiagnosticFrontendKinds.inc"
23+
#undef DIAG
24+
NUM_BUILTIN_FRONTEND_DIAGNOSTICS
25+
};
26+
} // end namespace diag
27+
} // end namespace clang
28+
29+
#endif // LLVM_CLANG_BASIC_DIAGNOSTICFRONTEND_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- DiagnosticLex.h - Diagnostics for liblex ---------------*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_CLANG_BASIC_DIAGNOSTICLEX_H
11+
#define LLVM_CLANG_BASIC_DIAGNOSTICLEX_H
12+
13+
#include "clang/Basic/Diagnostic.h"
14+
15+
namespace clang {
16+
namespace diag {
17+
enum {
18+
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
19+
SHOWINSYSHEADER, CATEGORY) \
20+
ENUM,
21+
#define LEXSTART
22+
#include "clang/Basic/DiagnosticLexKinds.inc"
23+
#undef DIAG
24+
NUM_BUILTIN_LEX_DIAGNOSTICS
25+
};
26+
} // end namespace diag
27+
} // end namespace clang
28+
29+
#endif // LLVM_CLANG_BASIC_DIAGNOSTICLEX_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- DiagnosticParse.h - Diagnostics for libparse -----------*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_CLANG_BASIC_DIAGNOSTICPARSE_H
11+
#define LLVM_CLANG_BASIC_DIAGNOSTICPARSE_H
12+
13+
#include "clang/Basic/Diagnostic.h"
14+
15+
namespace clang {
16+
namespace diag {
17+
enum {
18+
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
19+
SHOWINSYSHEADER, CATEGORY) \
20+
ENUM,
21+
#define PARSESTART
22+
#include "clang/Basic/DiagnosticParseKinds.inc"
23+
#undef DIAG
24+
NUM_BUILTIN_PARSE_DIAGNOSTICS
25+
};
26+
} // end namespace diag
27+
} // end namespace clang
28+
29+
#endif // LLVM_CLANG_BASIC_DIAGNOSTICPARSE_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- DiagnosticRefactoring.h - ------------------------------*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_CLANG_BASIC_DIAGNOSTICREFACTORING_H
11+
#define LLVM_CLANG_BASIC_DIAGNOSTICREFACTORING_H
12+
13+
#include "clang/Basic/Diagnostic.h"
14+
15+
namespace clang {
16+
namespace diag {
17+
enum {
18+
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
19+
SHOWINSYSHEADER, CATEGORY) \
20+
ENUM,
21+
#define REFACTORINGSTART
22+
#include "clang/Basic/DiagnosticRefactoringKinds.inc"
23+
#undef DIAG
24+
NUM_BUILTIN_REFACTORING_DIAGNOSTICS
25+
};
26+
} // end namespace diag
27+
} // end namespace clang
28+
29+
#endif // LLVM_CLANG_BASIC_DIAGNOSTICREFACTORING_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- DiagnosticSema.h - Diagnostics for libsema -------------*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_CLANG_BASIC_DIAGNOSTICSEMA_H
11+
#define LLVM_CLANG_BASIC_DIAGNOSTICSEMA_H
12+
13+
#include "clang/Basic/Diagnostic.h"
14+
15+
namespace clang {
16+
namespace diag {
17+
enum {
18+
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
19+
SHOWINSYSHEADER, CATEGORY) \
20+
ENUM,
21+
#define SEMASTART
22+
#include "clang/Basic/DiagnosticSemaKinds.inc"
23+
#undef DIAG
24+
NUM_BUILTIN_SEMA_DIAGNOSTICS
25+
};
26+
} // end namespace diag
27+
} // end namespace clang
28+
29+
#endif // LLVM_CLANG_BASIC_DIAGNOSTICSEMA_H

0 commit comments

Comments
 (0)