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