[llvm] 41eafdf - [TableGen] Format document

via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 26 20:28:00 PDT 2023


Author: wangpc
Date: 2023-03-27T11:27:35+08:00
New Revision: 41eafdf9aac4bd23ebff90d072eb595dfc143b7b

URL: https://github.com/llvm/llvm-project/commit/41eafdf9aac4bd23ebff90d072eb595dfc143b7b
DIFF: https://github.com/llvm/llvm-project/commit/41eafdf9aac4bd23ebff90d072eb595dfc143b7b.diff

LOG: [TableGen] Format document

Add missing bang operators and reorder them in alphabetical order.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D146687

Added: 
    

Modified: 
    llvm/docs/TableGen/ProgRef.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/TableGen/ProgRef.rst b/llvm/docs/TableGen/ProgRef.rst
index 8c74831505633..9cada3b7aaf67 100644
--- a/llvm/docs/TableGen/ProgRef.rst
+++ b/llvm/docs/TableGen/ProgRef.rst
@@ -219,14 +219,15 @@ TableGen provides "bang operators" that have a wide variety of uses:
 
 .. productionlist::
    BangOperator: one of
-               : !add        !and         !cast        !con         !dag
-               : !div        !empty       !eq          !filter      !find
-               : !foldl      !foreach     !ge          !getdagop    !gt
-               : !head       !if          !interleave  !isa         !le
-               : !listconcat !listremove  !listsplat   !logtwo      !lt
-               : !mul        !ne          !not         !or          !setdagop
-               : !shl        !size        !sra         !srl         !strconcat
-               : !sub        !subst       !substr      !tail        !xor
+               : !add         !and         !cast        !con         !dag
+               : !div         !empty       !eq          !exists      !filter
+               : !find        !foldl       !foreach     !ge          !getdagop
+               : !gt          !head        !if          !interleave  !isa
+               : !le          !listconcat  !listremove  !listsplat   !logtwo
+               : !lt          !mul         !ne          !not         !or
+               : !setdagop    !shl         !size        !sra         !srl
+               : !strconcat   !sub         !subst       !substr      !tail
+               : !tolower     !toupper     !xor
 
 The ``!cond`` operator has a slightly 
diff erent
 syntax compared to other bang operators, so it is defined separately:
@@ -1630,17 +1631,15 @@ and non-0 as true.
     This operator produces 1 if the string, list, or DAG *a* is empty; 0 otherwise.
     A dag is empty if it has no arguments; the operator does not count.
 
-``!tolower(``\ *a*\ ``)``
-  This operator converts a string input *a* to lower case.
-
-``!toupper(``\ *a*\ ``)``
-  This operator converts a string input *a* to upper case.
-
 ``!eq(`` *a*\ `,` *b*\ ``)``
     This operator produces 1 if *a* is equal to *b*; 0 otherwise.
     The arguments must be ``bit``, ``bits``, ``int``, ``string``, or
     record values. Use ``!cast<string>`` to compare other types of objects.
 
+``!exists<``\ *type*\ ``>(``\ *name*\ ``)``
+    This operator produces 1 if a record of the given *type* whose name is *name*
+    exists; 0 otherwise. *name* should be of type *string*.
+
 ``!filter(``\ *var*\ ``,`` *list*\ ``,`` *predicate*\ ``)``
 
     This operator creates a new ``list`` by filtering the elements in
@@ -1734,10 +1733,6 @@ and non-0 as true.
     This operator produces 1 if the type of *a* is a subtype of the given *type*; 0
     otherwise.
 
-``!exists<``\ *type*\ ``>(``\ *name*\ ``)``
-    This operator produces 1 if a record of the given *type* whose name is *name*
-    exists; 0 otherwise. *name* should be of type *string*.
-
 ``!le(``\ *a*\ ``,`` *b*\ ``)``
     This operator produces 1 if *a* is less than or equal to *b*; 0 otherwise.
     The arguments must be ``bit``, ``bits``, ``int``, or ``string`` values.
@@ -1834,6 +1829,12 @@ and non-0 as true.
     This operator produces a new list with all the elements
     of the list *a* except for the zeroth one. (See also ``!head``.)
 
+``!tolower(``\ *a*\ ``)``
+  This operator converts a string input *a* to lower case.
+
+``!toupper(``\ *a*\ ``)``
+  This operator converts a string input *a* to upper case.
+
 ``!xor(``\ *a*\ ``,`` *b*\ ``, ...)``
     This operator does a bitwise EXCLUSIVE OR on *a*, *b*, etc., and produces
     the result. A logical XOR can be performed if all the arguments are either


        


More information about the llvm-commits mailing list