Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you wrap this with a used attribute and an obsolute attribute. E.x.:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Forgot to add the LLVM_ATTRIBUTE_USED). So it would actually bt his:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't use LLVM_ATTRIBUTE_DEPRECATED because it's not a declaration, it's a trivial inline function definition around SILInstruction::dump() and I didn't want to declare it separately. Incidentally, SILInstruction::dump() is not declared as LLVM_ATTRIBUTE_DEPRECATED either, and it's expected to call these functions within the source to generate debug output.
LLVM_ATTRIBUTE_USED makes perfect sense.
I frankly don't understand the use-case for using both of these attributes together. What problem is solved by polluting the code with LLVM_ATTRIBUTE_DEPRECATED? Sometimes people (like me) accidentally commit a wayward debug print call that's not under a flag for a short time, but I don't see that as a serious problem that the attribute can solve in the common case.