Skip to content

Switch out asserts for llvm_unreachable #17770

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

Closed

Conversation

airspeedswift
Copy link
Member

#16237 introduced fall through warnings when building without asserts, this replaces them with llvm_unreachable

@airspeedswift
Copy link
Member Author

@swift-ci please test

Copy link
Contributor

@davezarzycki davezarzycki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "problem" with llvm_unreachable is that debug builds can fail because not every library links against the requisite LLVM support library, even though they include this file (perhaps indirectly). Please test the debug build first because this failed for my configuration.

@airspeedswift
Copy link
Member Author

airspeedswift commented Jul 5, 2018

We can't live with this number of asserts for very long – it's not just an annoyance, it also fills up CI logs. If a quick fix like this isn't enough, we'd probably have to revert the other patch.

edit: sorry, meant this number of warnings not asserts

@davezarzycki
Copy link
Contributor

Let me make another attempt at fixing CMake files when building debug. Otherwise we'll need to use LLVM_BUILTIN_UNREACHABLE.

@davezarzycki
Copy link
Contributor

Do I have permission to push to this branch if I fix the CMake files?

@airspeedswift
Copy link
Member Author

airspeedswift commented Jul 5, 2018

sure, I think the right boxes are checked

@jrose-apple
Copy link
Contributor

Just to be clear, please don't push to the branch directly. You should always be going through PR testing.

@davezarzycki
Copy link
Contributor

So I have llvm_unreachable working, but I can't fix the remote mirror CMakeLists.txt "correctly". For some reason, LLVM_COMPONENT_DEPENDS is being ignored, but if I force add -lLLVMSupport to LINK_FLAGS, then the build works. What do you want to do?

@davezarzycki
Copy link
Contributor

Oh wait, never mind, this seems intentional. TARGET_LIRARY disables stuff like LLVM_COMPONENT_DEPENDS. Time to try plan B: LLVM_BUILTIN_UNREACHABLE

@davezarzycki
Copy link
Contributor

It looks like pushing to your branch isn't worth the trouble for a hot fix like this. I've testing #17772 now. That solves the accidental fall through warning and avoids using llvm_unreachable in stdlib code.

@airspeedswift
Copy link
Member Author

@jrose-apple I think he meant push to my fork's PR branch – which GitHub should allow.

@davezarzycki
Copy link
Contributor

Hi @airspeedswift – Yes, that is what I meant, but as I quickly discovered, that would have meant temporarily adding your repo/branch as a remote on my repo, and that doesn't seem to be worth the trouble for a hot fix.

@airspeedswift
Copy link
Member Author

Closing as superseded by #17772

@swift-ci
Copy link
Contributor

swift-ci commented Jul 5, 2018

Build failed
Swift Test OS X Platform
Git Sha - b284a80

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.

4 participants