[llvm] [TableGen][Docs] ValueList should allow a trailing comma (PR #124728)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 03:09:47 PST 2025


https://github.com/jayfoad updated https://github.com/llvm/llvm-project/pull/124728

>From 21fd829e809f1771bc486c3935061634c660bd44 Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Tue, 28 Jan 2025 10:57:58 +0000
Subject: [PATCH 1/2] [TableGen][Docs] ValueList should allow a trailing comma

TableGen accepts trailing commas like [1,2,] and {1,2,}.
---
 llvm/docs/TableGen/ProgRef.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/docs/TableGen/ProgRef.rst b/llvm/docs/TableGen/ProgRef.rst
index cfe61382658ec4..74fb2bea25233c 100644
--- a/llvm/docs/TableGen/ProgRef.rst
+++ b/llvm/docs/TableGen/ProgRef.rst
@@ -392,7 +392,7 @@ A question mark represents an uninitialized value.
 .. productionlist::
    SimpleValue4: "{" [`ValueList`] "}"
    ValueList: `ValueListNE`
-   ValueListNE: `Value` ("," `Value`)*
+   ValueListNE: `Value` ("," `Value`)* [","]
 
 This value represents a sequence of bits, which can be used to initialize a
 ``bits<``\ *n*\ ``>`` field (note the braces). When doing so, the values

>From 57457de822b1ee716cad9cbc9cf31373d08925d9 Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Tue, 28 Jan 2025 11:09:32 +0000
Subject: [PATCH 2/2] Also update CondOperator

---
 llvm/docs/TableGen/ProgRef.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/docs/TableGen/ProgRef.rst b/llvm/docs/TableGen/ProgRef.rst
index 74fb2bea25233c..be70811370d379 100644
--- a/llvm/docs/TableGen/ProgRef.rst
+++ b/llvm/docs/TableGen/ProgRef.rst
@@ -488,7 +488,7 @@ See `Using Classes as Subroutines`_ for more information.
 
 .. productionlist::
    SimpleValue9: `BangOperator` ["<" `Type` ">"] "(" `ValueListNE` ")"
-              :| `CondOperator` "(" `CondClause` ("," `CondClause`)* ")"
+              :| `CondOperator` "(" `CondClause` ("," `CondClause`)* [","] ")"
    CondClause: `Value` ":" `Value`
 
 The bang operators provide functions that are not available with the other



More information about the llvm-commits mailing list