]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.td
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / llvm / tools / clang / include / clang / Basic / Diagnostic.td
1 //===--- Diagnostic.td - C Language Family Diagnostic Handling ------------===//
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 //  This file defines the TableGen core definitions for the diagnostics
11 //  and diagnostic control.
12 //
13 //===----------------------------------------------------------------------===//
14
15 // Define the diagnostic mappings.
16 class DiagMapping;
17 def MAP_IGNORE  : DiagMapping;
18 def MAP_WARNING : DiagMapping;
19 def MAP_ERROR   : DiagMapping;
20 def MAP_FATAL   : DiagMapping;
21
22 // Define the diagnostic classes.
23 class DiagClass;
24 def CLASS_NOTE      : DiagClass;
25 def CLASS_WARNING   : DiagClass;
26 def CLASS_EXTENSION : DiagClass;
27 def CLASS_ERROR     : DiagClass;
28
29 // Diagnostic Categories.  These can be applied to groups or individual
30 // diagnostics to specify a category.
31 class DiagCategory<string Name> {
32   string CategoryName = Name;
33 }
34
35 // Diagnostic Groups.
36 class DiagGroup<string Name, list<DiagGroup> subgroups = []> {
37   string GroupName = Name;
38   list<DiagGroup> SubGroups = subgroups;
39   string CategoryName = "";
40 }
41 class InGroup<DiagGroup G> { DiagGroup Group = G; }
42 //class IsGroup<string Name> { DiagGroup Group = DiagGroup<Name>; }
43
44
45 // This defines all of the named diagnostic categories.
46 include "DiagnosticCategories.td"
47
48 // This defines all of the named diagnostic groups.
49 include "DiagnosticGroups.td"
50
51
52 // All diagnostics emitted by the compiler are an indirect subclass of this.
53 class Diagnostic<string text, DiagClass DC, DiagMapping defaultmapping> {
54   /// Component is specified by the file with a big let directive.
55   string      Component = ?;
56   string      Text = text;
57   DiagClass   Class = DC;
58   bit         SFINAE = 1;
59   bit         AccessControl = 0;
60   bit         WarningNoWerror = 0;
61   bit         WarningShowInSystemHeader = 0;
62   DiagMapping DefaultMapping = defaultmapping;
63   DiagGroup   Group;
64   string      CategoryName = "";
65 }
66
67 class Error<string str>     : Diagnostic<str, CLASS_ERROR, MAP_ERROR>;
68 class Warning<string str>   : Diagnostic<str, CLASS_WARNING, MAP_WARNING>;
69 class Extension<string str> : Diagnostic<str, CLASS_EXTENSION, MAP_IGNORE>;
70 class ExtWarn<string str>   : Diagnostic<str, CLASS_EXTENSION, MAP_WARNING>;
71 class Note<string str>      : Diagnostic<str, CLASS_NOTE, MAP_FATAL/*ignored*/>;
72
73
74 class DefaultIgnore { DiagMapping DefaultMapping = MAP_IGNORE; }
75 class DefaultWarn   { DiagMapping DefaultMapping = MAP_WARNING; }
76 class DefaultError  { DiagMapping DefaultMapping = MAP_ERROR; }
77 class DefaultFatal  { DiagMapping DefaultMapping = MAP_FATAL; }
78 class DefaultWarnNoWerror {
79   bit WarningNoWerror = 1;
80 }
81 class DefaultWarnShowInSystemHeader {
82   bit WarningShowInSystemHeader = 1;
83 }
84
85 class NoSFINAE { bit SFINAE = 0; }
86 class AccessControl { bit AccessControl = 1; }
87
88 // Definitions for Diagnostics.
89 include "DiagnosticASTKinds.td"
90 include "DiagnosticAnalysisKinds.td"
91 include "DiagnosticCommentKinds.td"
92 include "DiagnosticCommonKinds.td"
93 include "DiagnosticDriverKinds.td"
94 include "DiagnosticFrontendKinds.td"
95 include "DiagnosticLexKinds.td"
96 include "DiagnosticParseKinds.td"
97 include "DiagnosticSemaKinds.td"
98 include "DiagnosticSerializationKinds.td"
99