diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-06 18:18:20 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-06 18:18:20 +0000 |
commit | 29063554d057ed8aa6ae69b2719c62d24e00e469 (patch) | |
tree | 0ca2ac61e2ce41d1ff73bf82ed55d109503b28bf /tools | |
parent | 6a6cd729aa118a4772d8ab0e9072feb1b4def4d2 (diff) | |
download | llvm-29063554d057ed8aa6ae69b2719c62d24e00e469.tar.gz llvm-29063554d057ed8aa6ae69b2719c62d24e00e469.tar.bz2 llvm-29063554d057ed8aa6ae69b2719c62d24e00e469.tar.xz |
Add new edge property combinator: weight.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvmc2/Common.td | 5 | ||||
-rw-r--r-- | tools/llvmc2/doc/LLVMC-Tutorial.rst | 15 |
2 files changed, 15 insertions, 5 deletions
diff --git a/tools/llvmc2/Common.td b/tools/llvmc2/Common.td index db28841afb..32e0180f8b 100644 --- a/tools/llvmc2/Common.td +++ b/tools/llvmc2/Common.td @@ -53,6 +53,7 @@ def element_in_list; def if_input_languages_contain; // Edge property combinators. +def weight; def and; def or; @@ -77,8 +78,8 @@ class EdgeBase<Tool t1, Tool t2, list<dag> lst> { 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 91a0561bd4..b8a364f606 100644 --- a/tools/llvmc2/doc/LLVMC-Tutorial.rst +++ b/tools/llvmc2/doc/LLVMC-Tutorial.rst @@ -120,11 +120,20 @@ specify one default edge *per language*). 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 |