]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.td
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.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 def MAP_WARNING_NO_WERROR             : DiagMapping;
22 def MAP_WARNING_SHOW_IN_SYSTEM_HEADER : DiagMapping;
23
24 // Define the diagnostic classes.
25 class DiagClass;
26 def CLASS_NOTE      : DiagClass;
27 def CLASS_WARNING   : DiagClass;
28 def CLASS_EXTENSION : DiagClass;
29 def CLASS_ERROR     : DiagClass;
30
31 // Diagnostic Categories.  These can be applied to groups or individual
32 // diagnostics to specify a category.
33 class DiagCategory<string Name> {
34   string CategoryName = Name;
35 }
36
37 // Diagnostic Groups.
38 class DiagGroup<string Name, list<DiagGroup> subgroups = []> {
39   string GroupName = Name;
40   list<DiagGroup> SubGroups = subgroups;
41   string CategoryName = "";
42 }
43 class InGroup<DiagGroup G> { DiagGroup Group = G; }
44 //class IsGroup<string Name> { DiagGroup Group = DiagGroup<Name>; }
45
46
47 // This defines all of the named diagnostic categories.
48 include "DiagnosticCategories.td"
49
50 // This defines all of the named diagnostic groups.
51 include "DiagnosticGroups.td"
52
53
54 // All diagnostics emitted by the compiler are an indirect subclass of this.
55 class Diagnostic<string text, DiagClass DC, DiagMapping defaultmapping> {
56   /// Component is specified by the file with a big let directive.
57   string      Component = ?;
58   string      Text = text;
59   DiagClass   Class = DC;
60   bit         SFINAE = 1;
61   bit         AccessControl = 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 { DiagMapping DefaultMapping= MAP_WARNING_NO_WERROR; }
81 class DefaultWarnShowInSystemHeader {
82   DiagMapping DefaultMapping = MAP_WARNING_SHOW_IN_SYSTEM_HEADER;
83 }
84
85 class NoSFINAE { bit SFINAE = 0; }
86 class AccessControl { bit AccessControl = 1; }
87
88 class Brief<string str> { string Brief = str; }
89 class FullExplanation<string brief, string full> {
90   string Brief = brief;
91   string Explanation = full;
92 }
93
94 // Definitions for Diagnostics.
95 include "DiagnosticASTKinds.td"
96 include "DiagnosticAnalysisKinds.td"
97 include "DiagnosticCommonKinds.td"
98 include "DiagnosticDriverKinds.td"
99 include "DiagnosticFrontendKinds.td"
100 include "DiagnosticLexKinds.td"
101 include "DiagnosticParseKinds.td"
102 include "DiagnosticSemaKinds.td"
103