aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvmc2/Common.td
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvmc2/Common.td')
-rw-r--r--tools/llvmc2/Common.td28
1 files changed, 24 insertions, 4 deletions
diff --git a/tools/llvmc2/Common.td b/tools/llvmc2/Common.td
index ea211e1..4435857 100644
--- a/tools/llvmc2/Common.td
+++ b/tools/llvmc2/Common.td
@@ -15,7 +15,7 @@ class Tool<list<dag> l> {
list<dag> properties = l;
}
-// Special Tool instance - root of all toolchains
+// Special Tool instance - graph root.
def root : Tool<[]>;
@@ -45,6 +45,17 @@ def unpack_values;
def help;
def required;
+// Possible edge properties
+
+def switch_on;
+def parameter_equals;
+def element_in_list;
+
+// Property combinators
+// TOFIX: implement
+def and;
+def or;
+
// Map from suffixes to language names
class LangToSuffixes<string str, list<string> lst> {
@@ -58,11 +69,20 @@ class LanguageMap<list<LangToSuffixes> lst> {
// Compilation graph
-class Edge<Tool t1, Tool t2> {
+class EdgeBase<Tool t1, Tool t2, list<dag> lst> {
Tool a = t1;
Tool b = t2;
+ list<dag> props = lst;
}
-class CompilationGraph<list<Edge> lst> {
- list<Edge> edges = lst;
+class Edge<Tool t1, Tool t2> : EdgeBase<t1, t2, []>;
+
+// Edge and DefaultEdge are synonyms.
+class DefaultEdge<Tool t1, Tool t2> : EdgeBase<t1, t2, []>;
+
+// Optionally enabled edge.
+class OptionalEdge<Tool t1, Tool t2, list<dag> lst> : EdgeBase<t1, t2, lst>;
+
+class CompilationGraph<list<EdgeBase> lst> {
+ list<EdgeBase> edges = lst;
}