-
Notifications
You must be signed in to change notification settings - Fork 10.5k
AST: Rename debugger pretty printer Type::dumpPrint
to print
#77920
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
This is actually inconsistent. "print" is never used for debug dumping. You can see this by doing a git grep of SWIFT_DEBUG_DUMPER in the code base. Just a small sample:
It is always some variant of "dumpX". print is always used for the non-debug dump variant that can be called programatically.
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.
Yeah, in that sense the name is inconsistent. But is that an intentional consistency? I personally find
print
useful for debugging and want to be able to call it on AST nodes from the debugger by the same name (just as I would by print debugging) without it forcing me to provide arguments, only to fail to resolve some LLVM symbols because my LLVM build is RelWithDebInfo. I also don’t want other contributors to have a hard time figuring out how to spell these out in the debugger.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.
@beccadax Hey Becca, I would appreciate an opinion on this.
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.
dump() means "print detailed s-expression notation" while print() is "print this node as Swift source". Renaming dumpPrint() to print() is fine, because it just calls the other overload of print().
We similarly overload dump() for no arguments vs a stream argument as well.