Skip to content

[4.2] [PlaygroundTransform] Replace "$builtin" with "__builtin". #17822

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

Conversation

cwakamo
Copy link
Contributor

@cwakamo cwakamo commented Jul 7, 2018

Currently, the playground transform requires the use of dollar-identifiers as the functions are prefixed with "$builtin".
This commit removes that requirement by replacing "$builtin" with "__builtin".
This aligns with the PC macro.

This is the swift-4.2-branch equivalent of #14257. I'll add Swift 4.2 nomination information after it passes testing.

This addresses rdar://problem/36031860.

Currently, the playground transform requires the use of dollar-identifiers as the functions are prefixed with "$builtin".
This commit removes that requirement by replacing "$builtin" with "__builtin".
This aligns with the PC macro.

This addresses <rdar://problem/36031860>.
@cwakamo
Copy link
Contributor Author

cwakamo commented Jul 7, 2018

Please test with this PR:

apple/swift-lldb#751

@swift-ci Please test

@cwakamo cwakamo requested a review from jrose-apple July 9, 2018 18:12
@cwakamo
Copy link
Contributor Author

cwakamo commented Jul 9, 2018

@jrose-apple I would greatly appreciate it if you could re-review this for Swift 4.2 nomination purposes!

@jrose-apple
Copy link
Contributor

jrose-apple commented Jul 9, 2018

It looks fine to me! Does still need the nomination process, though.

@cwakamo
Copy link
Contributor Author

cwakamo commented Jul 9, 2018

• Explanation: Currently, the playground transform uses symbols like $builtin_log_with_id and others as the functions the compiler inserts calls to when running the transform. This means that playgrounds must be compiled with $-identifiers enabled, but this is suboptimal and effectively means that playgrounds must be built in a debugger-like context. To support more easily building with the playground transform with an unmodified compiler, as well as to bring the playground transform in alignment with the related PC macro, this change switches the playground transform to using functions named with a builtin* prefix instead of a $builtin* prefix. This change also updates lldb to use builtin* when setting up the playground transform instead of $builtin.
• Scope of Issue: Affects the playground transform and lldb playground expressions.
• Origination: The original design of playgrounds used $builtin_
because it was only invoked from the debugger.
• Risk: Low
• Reviewed By: Swift changes reviewed by @jrose-apple, and LLDB changes reviewed by @dcci and @jimingham
• Testing: Update the Swift and LLDB test suites to use _builtin* and observed no regressions.

@cwakamo cwakamo merged commit 27c4f07 into swiftlang:swift-4.2-branch Jul 10, 2018
@cwakamo cwakamo deleted the remove-dollar-from-playgrounds-4.2 branch July 10, 2018 17:18
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

Successfully merging this pull request may close these issues.

2 participants