Skip to content
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

Mangling back? #12

Open
nerdsupremacist opened this issue Feb 19, 2020 · 0 comments
Open

Mangling back? #12

nerdsupremacist opened this issue Feb 19, 2020 · 0 comments

Comments

@nerdsupremacist
Copy link
Contributor

nerdsupremacist commented Feb 19, 2020

Sorry for the very weird question 😅

Is there a way to go back to the mangled version?

If for instance if I have a function:

Mangled:

$s6Module3FooC3bar3bazSayAA3BarVGSi_tF

Demangled:

Module.Foo.bar(baz: Swift.Int) -> Swift.Array<Module.Bar>

And if I want a specific part mangled back. For example for Swift.Int:

$sSiN

I'm not looking for anyone to fix this for me. I'm happy to implement it myself 🙃 .
Would just like some idea of how to change the code to accommodate.

My idea so far was to keep track of the area in the mangled string for a specific node in the AST and just store that, in the SwiftSymbol Object. But we still need to resolve how to mangle the module name back: i.e. how do I go from Swift.Array<Module.Bar> to $s[...]6Module3Bar[...]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant