]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.td
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.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   string      Brief = "";
66   string      Explanation = "";
67 }
68
69 class Error<string str>     : Diagnostic<str, CLASS_ERROR, MAP_ERROR>;
70 class Warning<string str>   : Diagnostic<str, CLASS_WARNING, MAP_WARNING>;
71 class Extension<string str> : Diagnostic<str, CLASS_EXTENSION, MAP_IGNORE>;
72 class ExtWarn<string str>   : Diagnostic<str, CLASS_EXTENSION, MAP_WARNING>;
73 class Note<string str>      : Diagnostic<str, CLASS_NOTE, MAP_FATAL/*ignored*/>;
74
75
76 class DefaultIgnore { DiagMapping DefaultMapping = MAP_IGNORE; }
77 class DefaultWarn   { DiagMapping DefaultMapping = MAP_WARNING; }
78 class DefaultError  { DiagMapping DefaultMapping = MAP_ERROR; }
79 class DefaultFatal  { DiagMapping DefaultMapping = MAP_FATAL; }
80 class DefaultWarnNoWerror {
81   bit WarningNoWerror = 1;
82 }
83 class DefaultWarnShowInSystemHeader {
84   bit WarningShowInSystemHeader = 1;
85 }
86
87 class NoSFINAE { bit SFINAE = 0; }
88 class AccessControl { bit AccessControl = 1; }
89
90 class Brief<string str> { string Brief = str; }
91 class FullExplanation<string brief, string full> {
92   string Brief = brief;
93   string Explanation = full;
94 }
95
96 // Definitions for Diagnostics.
97 include "DiagnosticASTKinds.td"
98 include "DiagnosticAnalysisKinds.td"
99 include "DiagnosticCommonKinds.td"
100 include "DiagnosticDriverKinds.td"
101 include "DiagnosticFrontendKinds.td"
102 include "DiagnosticLexKinds.td"
103 include "DiagnosticParseKinds.td"
104 include "DiagnosticSemaKinds.td"
105