Add a logical 'not' operator to llvmc's TableGen dialect.
[oota-llvm.git] / include / llvm / CompilerDriver / Common.td
1 //===- Common.td - Common definitions for LLVMC2  ----------*- tablegen -*-===//
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 contains common definitions used in llvmc tool description files.
11 //
12 //===----------------------------------------------------------------------===//
13
14 class Tool<list<dag> l> {
15       list<dag> properties = l;
16 }
17
18 // Possible Tool properties.
19
20 def in_language;
21 def out_language;
22 def output_suffix;
23 def cmd_line;
24 def join;
25 def sink;
26 def actions;
27
28 // Possible option types.
29
30 def alias_option;
31 def switch_option;
32 def parameter_option;
33 def parameter_list_option;
34 def prefix_option;
35 def prefix_list_option;
36
37 // Possible option properties.
38
39 def extern;
40 def help;
41 def hidden;
42 def init;
43 def multi_val;
44 def one_or_more;
45 def really_hidden;
46 def required;
47 def zero_or_one;
48
49 // Empty DAG marker.
50 def empty;
51
52 // The 'case' construct.
53 def case;
54
55 // Boolean constants.
56 def true;
57 def false;
58
59 // Boolean operators.
60 def and;
61 def or;
62 def not;
63
64 // Primitive tests.
65 def switch_on;
66 def parameter_equals;
67 def element_in_list;
68 def input_languages_contain;
69 def not_empty;
70 def default;
71
72 // Possible actions.
73
74 def append_cmd;
75 def forward;
76 def forward_as;
77 def stop_compilation;
78 def unpack_values;
79 def error;
80
81 // Increase/decrease the edge weight.
82 def inc_weight;
83 def dec_weight;
84
85 // Used to specify plugin priority.
86 class PluginPriority<int p> {
87       int priority = p;
88 }
89
90 // Option list - used to specify aliases and sometimes help strings.
91 class OptionList<list<dag> l> {
92       list<dag> options = l;
93 }
94
95 // Map from suffixes to language names
96
97 class LangToSuffixes<string str, list<string> lst> {
98       string lang = str;
99       list<string> suffixes = lst;
100 }
101
102 class LanguageMap<list<LangToSuffixes> lst> {
103       list<LangToSuffixes> map = lst;
104 }
105
106 // Compilation graph
107
108 class EdgeBase<string t1, string t2, dag d> {
109       string a = t1;
110       string b = t2;
111       dag weight = d;
112 }
113
114 class Edge<string t1, string t2> : EdgeBase<t1, t2, (empty)>;
115
116 // Edge and SimpleEdge are synonyms.
117 class SimpleEdge<string t1, string t2> : EdgeBase<t1, t2, (empty)>;
118
119 // Optionally enabled edge.
120 class OptionalEdge<string t1, string t2, dag props> : EdgeBase<t1, t2, props>;
121
122 class CompilationGraph<list<EdgeBase> lst> {
123       list<EdgeBase> edges = lst;
124 }