diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-05-24 22:17:39 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-05-24 22:17:39 +0000 |
| commit | 36a5c8e55074b76eff6ddaf962413ad779c540b2 (patch) | |
| tree | 68213715b0179f8a4f3f813286e8c75474c7113d /llvm/docs/TableGenFundamentals.html | |
| parent | 74fd80e8fc5866f12818b3b54c6099efde871527 (diff) | |
| download | bcm5719-llvm-36a5c8e55074b76eff6ddaf962413ad779c540b2.tar.gz bcm5719-llvm-36a5c8e55074b76eff6ddaf962413ad779c540b2.zip | |
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 ...
llvm-svn: 157432
Diffstat (limited to 'llvm/docs/TableGenFundamentals.html')
| -rw-r--r-- | llvm/docs/TableGenFundamentals.html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/docs/TableGenFundamentals.html b/llvm/docs/TableGenFundamentals.html index 58f9876d721..5490eebb4fe 100644 --- a/llvm/docs/TableGenFundamentals.html +++ b/llvm/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 <var> = <list> in { <body> }</tt></dt> -<dt><tt>foreach <var> = <list> in <def></tt></dt> +<dt><tt>foreach <var> = [ <list> ] in { <body> }</tt></dt> +<dt><tt>foreach <var> = [ <list> ] in <def></tt></dt> <dd> Replicate <body> or <def>, replacing instances of <var> with each value in <list>. <var> is scoped at the level of the <tt>foreach</tt> loop and must not conflict with any other object introduced in <body> or <def>. Currently only <tt>def</tt>s are expanded within <body>. </dd> +<dt><tt>foreach <var> = 0-15 in ...</tt></dt> +<dt><tt>foreach <var> = {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 |

