Skip to content

[TableGen][Docs] Fix productionlists for assert and dump #123739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Jan 21, 2025

These were referring to nonexistent grammar tokens instead of Value.

These were referring to nonexistent grammar tokens instead of `Value`.
@llvmbot
Copy link
Member

llvmbot commented Jan 21, 2025

@llvm/pr-subscribers-tablegen

Author: Jay Foad (jayfoad)

Changes

These were referring to nonexistent grammar tokens instead of Value.


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

1 Files Affected:

  • (modified) llvm/docs/TableGen/ProgRef.rst (+6-5)
diff --git a/llvm/docs/TableGen/ProgRef.rst b/llvm/docs/TableGen/ProgRef.rst
index cfe61382658ec4..150033500a3f35 100644
--- a/llvm/docs/TableGen/ProgRef.rst
+++ b/llvm/docs/TableGen/ProgRef.rst
@@ -1302,7 +1302,7 @@ output. It is intended for debugging purpose.
   instantiation point of the containing record.
 
 .. productionlist::
-   Dump: "dump"  `string` ";"
+   Dump: "dump" `Value` ";"
 
 For example, it can be used in combination with `!repr` to investigate
 the values passed to a multiclass:
@@ -1350,11 +1350,12 @@ The ``assert`` statement checks a boolean condition to be sure that it is true
 and prints an error message if it is not.
 
 .. productionlist::
-   Assert: "assert" `condition` "," `message` ";"
+   Assert: "assert" `Value` "," `Value` ";"
 
-If the boolean condition is true, the statement does nothing. If the
-condition is false, it prints a nonfatal error message. The **message**, which
-can be an arbitrary string expression, is included in the error message as a
+The first :token:`Value` is a boolean condition. If it is true, the
+statement does nothing. If the condition is false, it prints a nonfatal
+error message. The second :token:`Value` is a message, which can be an
+arbitrary string expression. It is included in the error message as a
 note. The exact behavior of the ``assert`` statement depends on its
 placement.
 

Comment on lines 1304 to +1305
.. productionlist::
Dump: "dump" `string` ";"
Dump: "dump" `Value` ";"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description above this says "...prints the input string...". Maybe change that to reference Value too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing that description, I added a note below explaining that the Value is the string. This is similar to how assert is documented. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this seems better.

A subtlety is that even record types are accepted by dump (it silently wraps them in !repr), but I'm not sure if we should advertise that as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A subtlety is that even record types are accepted by dump (it silently wraps them in !repr), but I'm not sure if we should advertise that as well.

Yes I think that should be documented - but not in this patch.

@jayfoad jayfoad merged commit b275309 into llvm:main Feb 5, 2025
9 checks passed
@jayfoad jayfoad deleted the tablegen-docs-assert-dump branch February 5, 2025 11:03
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
These were referring to nonexistent grammar tokens instead of `Value`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants