Skip to content

SILOptimizer: use LLVM_ATTRIBUTE_USED #19276

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
merged 1 commit into from
Sep 13, 2018

Conversation

compnerd
Copy link
Member

This makes the use of the unused attribute more portable.
__attribute__((__unused__)) is not accepted by Visual Studio, but LLVM
conveniently provides the helpful macro LLVM_ATTRIBUTE_UNUSED to enable this.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

@compnerd
Copy link
Member Author

CC: @gottesmm

@compnerd
Copy link
Member Author

@swift-ci please test and merge

@harlanhaskins
Copy link
Contributor

Wouldn't you want to use LLVM_ATTRIBUTE_USED instead? IIRC we use used over unused so the linker doesn't strip it, for debugging.

@jrose-apple
Copy link
Contributor

Harlan is correct. I've cancelled the merge.

@compnerd
Copy link
Member Author

Ugh, yes, that is a typo. @jrose-apple - woah, how do you do that? And thank you for preventing the merge!

This makes the use of the used attribute more portable.
`__attribute__((__used__))` is not accepted by Visual Studio, but LLVM
conveniently provides the helpful macro `LLVM_ATTRIBUTE_USED` to enable this.
@compnerd compnerd changed the title SILOptimizer: use LLVM_ATTRIBUTE_UNUSED SILOptimizer: use LLVM_ATTRIBUTE_USED Sep 12, 2018
@compnerd
Copy link
Member Author

@swift-ci please test and merge

@jrose-apple
Copy link
Contributor

jrose-apple commented Sep 12, 2018

Unfortunately it's not a delegatable power—it requires logging into ci.swift.org with an Apple-internal ID. I'll check to see if we have a bug to get a swift-ci command for it.

@compnerd
Copy link
Member Author

@swift-ci please test and merge

@jrose-apple
Copy link
Contributor

Filed SR-8734.

@compnerd
Copy link
Member Author

@swift-ci please test macOS platform

@compnerd compnerd merged commit 6aae40c into swiftlang:master Sep 13, 2018
@compnerd compnerd deleted the unused-portability branch September 13, 2018 21:13
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.

3 participants