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.
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
Rudimentary name mangling support #4267
Rudimentary name mangling support #4267
Changes from 44 commits
450a2a2
5ef42c7
b879dc7
b692032
69d25d7
21a6391
c31e8c2
d6d2263
5feca3d
04b6dc3
12f35d4
26f1b4b
6d6b07e
c064332
c56c4f9
7438817
adc0aba
2c5cf62
248ca95
c835a9e
b86c11c
08c2576
e08c432
e169dc7
7d81cb5
6ab771e
6e199a0
e9f2cdd
a73c68e
2468626
004099a
c4d4be0
cbdb9cf
89e1301
fb13336
2a25c6f
071f514
7cec2ef
c99163d
24ba431
3d7f262
843b021
2ea5b0c
1c215f2
10f0633
0fefc7d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Sorry, I was kind of hoping @chandlerc would review and handle this in particular. I know we'd discussed
_C
as an option, but actually, considering swift mangling uses$s
, should we consider a similar$c
? I think one of the concerns with_C
might've been too high a risk of conflicting with a C-based name, but maybe using a special character in mangling is a good way to avoid that problem entirely? Or maybec.
if we think we can use.
in names?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 open to other ideas - The "_" form seems to be dominant, though (LLVM's demangler supports _Z for C++, _R for Rust, and _D for the D programming language).
Just looking at LLVM's demangler makes the fair point that a
.
prefix would be problematic (not that that's what you were suggesting) - because of the leading.
in ELF symbol names, so the demangler strips those off by default.Work backwards from _Z and use _Y (or perhaps _X, because X is cool)?
Though I'm really OK with whatever everyone else wants - and wouldn't totally object to using something following swift's pattern. So if $c is best for you, happy to switch to that.
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.
We can separate this out if you want to start with _C as probably good.
I was actually thinking further, and if
C.
orC$
were an option (upper or lower case), particularly using a non-identifier character as separators instead of prefix, it might both (a) make the name easy to read and (b) offer a name that couldn't conflict with a C name.But I'm realizing the difference between
_C
and$c
isn't actually that big for us: we should be suffixing all mangled names with the package scope (e.g.,_CFoo.Main
), which should already avoid name conflicts with C names if we're using.
separators. So if you don't thinkC<char>
is a good choice, let's stick with_C
for cross-language consistency.