Use (actions) instead of option properties, support external options.
[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 llvmc2 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 def extern_switch;
38 def extern_parameter;
39 def extern_list;
40
41 // Possible option properties.
42
43 def help;
44 def hidden;
45 def really_hidden;
46 def required;
47
48 // Empty DAG marker.
49 def empty;
50
51 // The 'case' construct.
52 def case;
53
54 // Boolean operators.
55 def and;
56 def or;
57
58 // Primitive tests.
59 def switch_on;
60 def parameter_equals;
61 def element_in_list;
62 def input_languages_contain;
63 def not_empty;
64 def default;
65
66 // Possible actions.
67
68 def append_cmd;
69 def forward;
70 def forward_as;
71 def stop_compilation;
72 def unpack_values;
73
74 // Increase/decrease the edge weight.
75 def inc_weight;
76 def dec_weight;
77
78 // Used to specify plugin priority.
79 class PluginPriority<int p> {
80       int priority = p;
81 }
82
83 // Option list - used to specify aliases and sometimes help strings.
84 class OptionList<list<dag> l> {
85       list<dag> options = l;
86 }
87
88 // Map from suffixes to language names
89
90 class LangToSuffixes<string str, list<string> lst> {
91       string lang = str;
92       list<string> suffixes = lst;
93 }
94
95 class LanguageMap<list<LangToSuffixes> lst> {
96       list<LangToSuffixes> map = lst;
97 }
98
99 // Compilation graph
100
101 class EdgeBase<string t1, string t2, dag d> {
102       string a = t1;
103       string b = t2;
104       dag weight = d;
105 }
106
107 class Edge<string t1, string t2> : EdgeBase<t1, t2, (empty)>;
108
109 // Edge and SimpleEdge are synonyms.
110 class SimpleEdge<string t1, string t2> : EdgeBase<t1, t2, (empty)>;
111
112 // Optionally enabled edge.
113 class OptionalEdge<string t1, string t2, dag props> : EdgeBase<t1, t2, props>;
114
115 class CompilationGraph<list<EdgeBase> lst> {
116       list<EdgeBase> edges = lst;
117 }