summaryrefslogtreecommitdiffstats
path: root/llvm/docs/TableGen/LangRef.rst
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2018-03-09 12:24:30 +0000
committerNicolai Haehnle <nhaehnle@gmail.com>2018-03-09 12:24:30 +0000
commit8aa9d5839dbb4d457616a935eb2167ceb0087dfa (patch)
treee5febda9150690cc52ae82ecb324b0447fb0c781 /llvm/docs/TableGen/LangRef.rst
parent2435855abe6ccb1cd874f0e5e699815a2697b73d (diff)
downloadbcm5719-llvm-8aa9d5839dbb4d457616a935eb2167ceb0087dfa.tar.gz
bcm5719-llvm-8aa9d5839dbb4d457616a935eb2167ceb0087dfa.zip
TableGen: Allow arbitrary list values as ranges of foreach
The changes to FieldInit are required to make field references (Def.field) work inside a ForeachDeclaration: previously, Def.field wasn't resolved immediately when Def was already a fully resolved DefInit. Change-Id: I9875baec2fc5aac8c2b249e45b9cf18c65ae699b llvm-svn: 327120
Diffstat (limited to 'llvm/docs/TableGen/LangRef.rst')
-rw-r--r--llvm/docs/TableGen/LangRef.rst8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/docs/TableGen/LangRef.rst b/llvm/docs/TableGen/LangRef.rst
index 89996f35822..702b40c9011 100644
--- a/llvm/docs/TableGen/LangRef.rst
+++ b/llvm/docs/TableGen/LangRef.rst
@@ -360,13 +360,17 @@ precede any ``class``'s that appear.
-----------
.. productionlist::
- Foreach: "foreach" `Declaration` "in" "{" `Object`* "}"
- :| "foreach" `Declaration` "in" `Object`
+ Foreach: "foreach" `ForeachDeclaration` "in" "{" `Object`* "}"
+ :| "foreach" `ForeachDeclaration` "in" `Object`
+ ForeachDeclaration: ID "=" ( "{" `RangeList` "}" | `RangePiece` | `Value` )
The value assigned to the variable in the declaration is iterated over and
the object or object list is reevaluated with the variable set at each
iterated value.
+Note that the productions involving RangeList and RangePiece have precedence
+over the more generic value parsing based on the first token.
+
Top-Level ``let``
-----------------
OpenPOWER on IntegriCloud