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

[SR-9483] llvm::Optional types are never trivial #51945

Closed
bob-wilson opened this issue Dec 12, 2018 · 1 comment
Closed

[SR-9483] llvm::Optional types are never trivial #51945

bob-wilson opened this issue Dec 12, 2018 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@bob-wilson
Copy link

Previous ID SR-9483
Radar rdar://problem/46128545
Original Reporter @bob-wilson
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, LLVM
Assignee None
Priority Medium

md5: 69c8929e46ae594aef2e8bca08d74297

Issue Description:

The Swift master-next build was recently broken by LLVM r347004, which removed some code from llvm::Optional to optimize for trivially copyable types. The build failed because of static_asserts checking that AST attributes are trivially destructible (PR #​19670).

The optimization was removed from LLVM because of an apparent bug in GCC that no one has yet figured out how to work around. In the meantime, I have reapplied the llvm::Optional code in the swift-llvm repo. It would be good to eventually find a way for Swift to work with LLVM's trunk without requiring this divergent change. It seems like std::optional is trivial for trivial types, so perhaps someday we can switch to use that. Or maybe the GCC bug will get fixed and llvm::Optional can re-add the optimization.

@bob-wilson
Copy link
Author

This was resolved with LLVM r354264. The swift-llvm workaround was removed.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

1 participant