-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[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
Conversation
These were referring to nonexistent grammar tokens instead of `Value`.
@llvm/pr-subscribers-tablegen Author: Jay Foad (jayfoad) ChangesThese were referring to nonexistent grammar tokens instead of Full diff: https://github.com/llvm/llvm-project/pull/123739.diff 1 Files Affected:
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.
|
.. productionlist:: | ||
Dump: "dump" `string` ";" | ||
Dump: "dump" `Value` ";" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
These were referring to nonexistent grammar tokens instead of `Value`.
These were referring to nonexistent grammar tokens instead of
Value
.