3ae77aeadf62e97f3077e5a4b745f90aa83d4395
[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 optional;
46 def really_hidden;
47 def required;
48 def comma_separated;
49 def forward_not_split;
50
51 // The 'case' construct.
52 def case;
53
54 // Boolean constants.
55 def true;
56 def false;
57
58 // Boolean operators.
59 def and;
60 def or;
61 def not;
62
63 // Primitive tests.
64 def switch_on;
65 def parameter_equals;
66 def element_in_list;
67 def input_languages_contain;
68 def empty;
69 def not_empty;
70 def default;
71 def single_input_file;
72 def multiple_input_files;
73 def any_switch_on;
74 def any_not_empty;
75 def any_empty;
76
77 // Possible actions.
78
79 def append_cmd;
80 def forward;
81 def forward_as;
82 def forward_value;
83 def forward_transformed_value;
84 def stop_compilation;
85 def unpack_values;
86 def warning;
87 def error;
88 def set_option;
89 def unset_option;
90
91 // Increase/decrease the edge weight.
92 def inc_weight;
93 def dec_weight;
94
95 // Empty DAG marker.
96 def empty_dag_marker;
97
98 // Used to specify plugin priority.
99 class PluginPriority<int p> {
100       int priority = p;
101 }
102
103 // Option list - a single place to specify options.
104 class OptionList<list<dag> l> {
105       list<dag> options = l;
106 }
107
108 // Option preprocessor - actions taken during plugin loading.
109 class OptionPreprocessor<dag d> {
110       dag preprocessor = d;
111 }
112
113 // Map from suffixes to language names
114
115 class LangToSuffixes<string str, list<string> lst> {
116       string lang = str;
117       list<string> suffixes = lst;
118 }
119
120 class LanguageMap<list<LangToSuffixes> lst> {
121       list<LangToSuffixes> map = lst;
122 }
123
124 // Compilation graph
125
126 class EdgeBase<string t1, string t2, dag d> {
127       string a = t1;
128       string b = t2;
129       dag weight = d;
130 }
131
132 class Edge<string t1, string t2> : EdgeBase<t1, t2, (empty_dag_marker)>;
133
134 // Edge and SimpleEdge are synonyms.
135 class SimpleEdge<string t1, string t2> : EdgeBase<t1, t2, (empty_dag_marker)>;
136
137 // Optionally enabled edge.
138 class OptionalEdge<string t1, string t2, dag props> : EdgeBase<t1, t2, props>;
139
140 class CompilationGraph<list<EdgeBase> lst> {
141       list<EdgeBase> edges = lst;
142 }