-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Some demangler changes #15461
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
Some demangler changes #15461
Conversation
@swift-ci smoke test and merge |
@jrose-apple Are you fine with requiring -stdin for swift-demangle to read from stdin? |
@eeckstein not sure if my opinion matters, but, I think that requiring the flag is a bit surprising. |
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.
I'm with @compnerd. swift-demangle
is supposed to act like c++filt
first and foremost; passing arguments on the command line is the convenient extra feature, not the original purpose.
no problem. I'll remove that change |
1cce059
to
cf23008
Compare
@jrose-apple I removed that commit |
@swift-ci smoke test |
@@ -175,7 +175,7 @@ static int demangleSTDIN(const swift::Demangle::DemangleOptions &options) { | |||
// This doesn't handle Unicode symbols, but maybe that's okay. | |||
// Also accept the future mangling prefix. | |||
// TODO: remove the "_S" as soon as MANGLING_PREFIX_STR gets "_S". | |||
llvm::Regex maybeSymbol("(_T|_*\\$S|" MANGLING_PREFIX_STR ")[_a-zA-Z0-9$.]+"); | |||
llvm::Regex maybeSymbol("_(T|\\$[Ss]|" MANGLING_PREFIX_STR ")[_a-zA-Z0-9$.]+"); |
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.
@graydon and I just noticed that MANGLING_PREFIX_STR
will have an unescaped $
in it, which means that things without the leading underscore weren't getting matched. Moving the underscore to the outside doesn't fix that either.
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.
Maybe "(_T|_?\\$[Ss])"
and leave out the MANGLING_PREFIX_STR
part entirely?
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.
argh...
Thanks for catching this! I thought I already fixed this, but apparently not.
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.
Well, you didn't regress it. :-)
rdar://problem/37681432
This makes it easier to copy-paste $S symbol names with a double-click. rdar://problem/38546308
cf23008
to
99b9256
Compare
@swift-ci smoke test and merge |
1 similar comment
@swift-ci smoke test and merge |
For details see the commit messages
rdar://problem/37681432
rdar://problem/38546308