[llvm] [TableGen][Docs] Improve productionlist for BangOperator (PR #123731)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 04:06:41 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-tablegen

Author: Jay Foad (jayfoad)

<details>
<summary>Changes</summary>

Quote literal strings and use the standard `|` operator instead of the
text "one of".


---
Full diff: https://github.com/llvm/llvm-project/pull/123731.diff


1 Files Affected:

- (modified) llvm/docs/TableGen/ProgRef.rst (+12-13) 


``````````diff
diff --git a/llvm/docs/TableGen/ProgRef.rst b/llvm/docs/TableGen/ProgRef.rst
index cfe61382658ec4..e4aad655d145ae 100644
--- a/llvm/docs/TableGen/ProgRef.rst
+++ b/llvm/docs/TableGen/ProgRef.rst
@@ -218,24 +218,23 @@ Bang operators
 TableGen provides "bang operators" that have a wide variety of uses:
 
 .. productionlist::
-   BangOperator: one of
-               : !add         !and         !cast        !con         !dag
-               : !div         !empty       !eq          !exists      !filter
-               : !find        !foldl       !foreach     !ge          !getdagarg
-               : !getdagname  !getdagop    !gt          !head        !if
-               : !initialized !interleave  !isa         !le          !listconcat
-               : !listflatten !listremove  !listsplat   !logtwo      !lt
-               : !mul         !ne          !not         !or          !range
-               : !repr        !setdagarg   !setdagname  !setdagop    !shl
-               : !size        !sra         !srl         !strconcat   !sub
-               : !subst       !substr      !tail        !tolower     !toupper
-               : !xor
+   BangOperator:  "!add"         | "!and"         | "!cast"        | "!con"         | "!dag"
+               :| "!div"         | "!empty"       | "!eq"          | "!exists"      | "!filter"
+               :| "!find"        | "!foldl"       | "!foreach"     | "!ge"          | "!getdagarg"
+               :| "!getdagname"  | "!getdagop"    | "!gt"          | "!head"        | "!if"
+               :| "!initialized" | "!interleave"  | "!isa"         | "!le"          | "!listconcat"
+               :| "!listflatten" | "!listremove"  | "!listsplat"   | "!logtwo"      | "!lt"
+               :| "!mul"         | "!ne"          | "!not"         | "!or"          | "!range"
+               :| "!repr"        | "!setdagarg"   | "!setdagname"  | "!setdagop"    | "!shl"
+               :| "!size"        | "!sra"         | "!srl"         | "!strconcat"   | "!sub"
+               :| "!subst"       | "!substr"      | "!tail"        | "!tolower"     | "!toupper"
+               :| "!xor"
 
 The ``!cond`` operator has a slightly different
 syntax compared to other bang operators, so it is defined separately:
 
 .. productionlist::
-   CondOperator: !cond
+   CondOperator: "!cond"
 
 See `Appendix A: Bang Operators`_ for a description of each bang operator.
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/123731


More information about the llvm-commits mailing list