Move target independent td files from lib/Target/ to include/llvm/Target so they...
[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
27 // Possible option types
28
29 def alias_option;
30 def switch_option;
31 def parameter_option;
32 def parameter_list_option;
33 def prefix_option;
34 def prefix_list_option;
35
36 // Possible option properties
37
38 def append_cmd;
39 def forward;
40 def forward_as;
41 def stop_compilation;
42 def unpack_values;
43 def help;
44 def required;
45
46 // Empty DAG marker.
47 def empty;
48
49 // The 'case' construct.
50 def case;
51
52 // Primitive tests.
53 def switch_on;
54 def parameter_equals;
55 def element_in_list;
56 def input_languages_contain;
57 def not_empty;
58 def default;
59
60 // Boolean operators.
61 def and;
62 def or;
63
64 // Increase/decrease the edge weight.
65 def inc_weight;
66 def dec_weight;
67
68 // Used to specify plugin priority.
69 class PluginPriority<int p> {
70       int priority = p;
71 }
72
73 // Option list - used to specify aliases and sometimes help strings.
74 class OptionList<list<dag> l> {
75       list<dag> options = l;
76 }
77
78 // Map from suffixes to language names
79
80 class LangToSuffixes<string str, list<string> lst> {
81       string lang = str;
82       list<string> suffixes = lst;
83 }
84
85 class LanguageMap<list<LangToSuffixes> lst> {
86       list<LangToSuffixes> map = lst;
87 }
88
89 // Compilation graph
90
91 class EdgeBase<string t1, string t2, dag d> {
92       string a = t1;
93       string b = t2;
94       dag weight = d;
95 }
96
97 class Edge<string t1, string t2> : EdgeBase<t1, t2, (empty)>;
98
99 // Edge and SimpleEdge are synonyms.
100 class SimpleEdge<string t1, string t2> : EdgeBase<t1, t2, (empty)>;
101
102 // Optionally enabled edge.
103 class OptionalEdge<string t1, string t2, dag props> : EdgeBase<t1, t2, props>;
104
105 class CompilationGraph<list<EdgeBase> lst> {
106       list<EdgeBase> edges = lst;
107 }