summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-24 22:17:39 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-24 22:17:39 +0000
commitfae8b1de47c004fefaa6c2683ae193d465b9d93f (patch)
tree26d07890a81e7e3d41ff71f57000d86383c00d59 /docs
parent72cba6cdf640411e2fb6207858a0abd87c4286fc (diff)
downloadllvm-fae8b1de47c004fefaa6c2683ae193d465b9d93f.tar.gz
llvm-fae8b1de47c004fefaa6c2683ae193d465b9d93f.tar.bz2
llvm-fae8b1de47c004fefaa6c2683ae193d465b9d93f.tar.xz
Add support for range expressions in TableGen foreach loops.
Like this: foreach i = 0-127 in ... Use braces for composite ranges: foreach i = {0-3,9-7} in ... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/TableGenFundamentals.html8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/TableGenFundamentals.html b/docs/TableGenFundamentals.html
index 58f9876d72..5490eebb4f 100644
--- a/docs/TableGenFundamentals.html
+++ b/docs/TableGenFundamentals.html
@@ -402,14 +402,18 @@ which case the user must specify it explicitly.</dd>
<dt><tt>list[4-7,17,2-3]</tt></dt>
<dd>A slice of the 'list' list, including elements 4,5,6,7,17,2, and 3 from
it. Elements may be included multiple times.</dd>
-<dt><tt>foreach &lt;var&gt; = &lt;list&gt; in { &lt;body&gt; }</tt></dt>
-<dt><tt>foreach &lt;var&gt; = &lt;list&gt; in &lt;def&gt;</tt></dt>
+<dt><tt>foreach &lt;var&gt; = [ &lt;list&gt; ] in { &lt;body&gt; }</tt></dt>
+<dt><tt>foreach &lt;var&gt; = [ &lt;list&gt; ] in &lt;def&gt;</tt></dt>
<dd> Replicate &lt;body&gt; or &lt;def&gt;, replacing instances of
&lt;var&gt; with each value in &lt;list&gt;. &lt;var&gt; is scoped at the
level of the <tt>foreach</tt> loop and must not conflict with any other object
introduced in &lt;body&gt; or &lt;def&gt;. Currently only <tt>def</tt>s are
expanded within &lt;body&gt;.
</dd>
+<dt><tt>foreach &lt;var&gt; = 0-15 in ...</tt></dt>
+<dt><tt>foreach &lt;var&gt; = {0-15,32-47} in ...</tt></dt>
+ <dd>Loop over ranges of integers. The braces are required for multiple
+ ranges.</dd>
<dt><tt>(DEF a, b)</tt></dt>
<dd>a dag value. The first element is required to be a record definition, the
remaining elements in the list may be arbitrary other values, including nested