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

Paul C. Anagnostopoulos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 7 07:18:03 PST 2022


Paul-C-Anagnostopoulos added inline comments.


================
Comment at: llvm/docs/TableGen/ProgRef.rst:333
    Value: `SimpleValue` `ValueSuffix`*
-        :| `Value` "#" `Value`
+        :| `Value` "#" [`Value`]
    ValueSuffix: "{" `RangeList` "}"
----------------
sebastian-ne wrote:
> 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
Yep, you are right. What a silly feature. I'm tempted to get rid of it and require `# ""`.

Anyhoo, can you update the description of the paste operator to explain what this does?


================
Comment at: llvm/docs/TableGen/ProgRef.rst:890
    MultiClass: "multiclass" `TokIdentifier` [`TemplateArgList`]
-             : [":" `ParentMultiClassList`]
+             : `ParentClassList`
              : "{" `MultiClassStatement`+ "}"
----------------
sebastian-ne wrote:
> 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?
Oh, what's there now is extraneous and incorrect. Carry on. Thanks!


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