Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@DaniPopes
Copy link
Contributor

@DaniPopes DaniPopes commented Apr 30, 2024

Description

Refactor the llvm_versions internal macro implementation and update its syntax to more closely match normal Rust syntax.

This means removing the latest special case in favor of half-open ranges (x..) and allowing to specify up to x (..x). This is also useful to have 2 different implementations of a function that changed at version y by having two items with llvm_version(..y) and llvm_version(y..), just like when slicing a string or a vector.

Since currently all supported versions are <major>.0.0, I've also allowed version specifiers to be just integers which represent just the major version.

This refactoring is in preparation to add a new cfg_attr-style macro for conditional attributes, for example deprecated, and to migrate remaining manual #[cfg(any(...))] to this macro.

The enum macro implementation is untouched, it was just moved to its own module.

How This Has Been Tested

Compiling a few selected LLVM versions.

Option<Breaking Changes>

Only to the llvm_versions internal macro.

Checklist

Copy link
Owner

@TheDan64 TheDan64 left a comment

Choose a reason for hiding this comment

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

Thanks!

@TheDan64 TheDan64 merged commit 6c0fb56 into TheDan64:master May 8, 2024
@DaniPopes DaniPopes deleted the update-macro branch May 8, 2024 21:56
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