[PATCH] D116674: [Docs] Fix IR and TableGen grammar inconsistencies

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 7 06:36:20 PST 2022


sebastian-ne added inline comments.


================
Comment at: llvm/docs/TableGen/ProgRef.rst:333
    Value: `SimpleValue` `ValueSuffix`*
-        :| `Value` "#" `Value`
+        :| `Value` "#" [`Value`]
    ValueSuffix: "{" `RangeList` "}"
----------------
Paul-C-Anagnostopoulos wrote:
> If we are going to specify that the right operand is optional, we should explain elsewhere what that does. I have no idea, but I'm suspicious that the example you cited above is an error.
Looking into the code, it looks like a feature?
```
// Trailing paste, concat with an empty string.
RHS = StringInit::get("");
```
https://github.com/llvm/llvm-project/blob/7c19fdd59939249c23384f0900d49aab4a5f0695/llvm/lib/TableGen/TGParser.cpp#L2521-L2522


================
Comment at: llvm/docs/TableGen/ProgRef.rst:890
    MultiClass: "multiclass" `TokIdentifier` [`TemplateArgList`]
-             : [":" `ParentMultiClassList`]
+             : `ParentClassList`
              : "{" `MultiClassStatement`+ "}"
----------------
Paul-C-Anagnostopoulos wrote:
> I'm tempted to leave this alone. It makes it clear that the ParentMultiClassList is composed of MultiClassIDs.
The problem is that `ParentMultiClassList` is only a list of identifiers, not of identifier + optional generic arguments.
The definition of `ParentClassList` actually references `MultiClassID` (and optional generic arguments) and is also used in the `defm` definition. So I think `ParentClassList` is correct here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116674/new/

https://reviews.llvm.org/D116674



More information about the llvm-commits mailing list