Add new edge property combinator: weight.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50765 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvmc2/Common.td b/tools/llvmc2/Common.td
index db28841..32e0180 100644
--- a/tools/llvmc2/Common.td
+++ b/tools/llvmc2/Common.td
@@ -53,6 +53,7 @@
 def if_input_languages_contain;
 
 // Edge property combinators.
+def weight;
 def and;
 def or;
 
@@ -77,8 +78,8 @@
 
 class Edge<Tool t1, Tool t2> : EdgeBase<t1, t2, []>;
 
-// Edge and DefaultEdge are synonyms.
-class DefaultEdge<Tool t1, Tool t2> : EdgeBase<t1, t2, []>;
+// Edge and SimpleEdge are synonyms.
+class SimpleEdge<Tool t1, Tool t2> : EdgeBase<t1, t2, []>;
 
 // Optionally enabled edge.
 class OptionalEdge<Tool t1, Tool t2, list<dag> lst> : EdgeBase<t1, t2, lst>;
diff --git a/tools/llvmc2/doc/LLVMC-Tutorial.rst b/tools/llvmc2/doc/LLVMC-Tutorial.rst
index 91a0561..b8a364f 100644
--- a/tools/llvmc2/doc/LLVMC-Tutorial.rst
+++ b/tools/llvmc2/doc/LLVMC-Tutorial.rst
@@ -120,11 +120,20 @@
     language belongs to the current input language set.
 
   - ``and`` - Edge property combinator. Returns true if all of its
-    arguments return true. Used like this: (and
-    (prop1), (prop2), ... (propN)). Nesting not allowed.
+    arguments return true. Used like this: ``(and (prop1), (prop2),
+    ... (propN))``. Nesting is allowed, but not encouraged.
 
   - ``or`` - Edge property combinator that returns true if any one of its
-    arguments returns true. Example: (or (prop1), (prop2), ... (propN))
+    arguments returns true. Example: ``(or (prop1), (prop2), ... (propN))``.
+
+  - ``weight`` - Makes it possible to explicitly specify the quantity
+    added to the edge weight if this edge property matches. Used like
+    this: ``(weight N, (prop))``. The inner property can include
+    ``and`` and ``or`` combinators. When N is equal to 2, equivalent
+    to ``(prop)``.
+
+    Example: ``(weight 8, (and (switch_on "a"), (switch_on "b")))``.
+
 
 To get a visual representation of the compilation graph (useful for
 debugging), run ``llvmc2 --view-graph``. You will need ``dot`` and