diff options
Diffstat (limited to 'llvm/docs/TableGen')
-rw-r--r-- | llvm/docs/TableGen/LangIntro.rst | 9 | ||||
-rw-r--r-- | llvm/docs/TableGen/LangRef.rst | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/llvm/docs/TableGen/LangIntro.rst b/llvm/docs/TableGen/LangIntro.rst index 7437723bf3b..67000fa03c6 100644 --- a/llvm/docs/TableGen/LangIntro.rst +++ b/llvm/docs/TableGen/LangIntro.rst @@ -217,6 +217,15 @@ supported include: of a variable that will be substituted by members of 'b' in 'c'. This operation is analogous to $(foreach) in GNU make. +``!foldl(start, lst, a, b, expr)`` + Perform a left-fold over 'lst' with the given starting value. 'a' and 'b' + are variable names which will be substituted in 'expr'. If you think of + expr as a function f(a,b), the fold will compute + 'f(...f(f(start, lst[0]), lst[1]), ...), lst[n-1])' for a list of length n. + As usual, 'a' will be of the type of 'start', and 'b' will be of the type + of elements of 'lst'. These types need not be the same, but 'expr' must be + of the same type as 'start'. + ``!head(a)`` The first element of list 'a.' diff --git a/llvm/docs/TableGen/LangRef.rst b/llvm/docs/TableGen/LangRef.rst index 5f7917a5b4b..5da852879d2 100644 --- a/llvm/docs/TableGen/LangRef.rst +++ b/llvm/docs/TableGen/LangRef.rst @@ -98,7 +98,7 @@ wide variety of meanings: :!eq !if !head !tail !con :!add !shl !sra !srl !and :!or !empty !subst !foreach !strconcat - :!cast !listconcat !size + :!cast !listconcat !size !foldl Syntax |