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