Christian Sigg via llvm-dev
2021-Jan-08 11:05 UTC
[llvm-dev] Change LLVM_ATTRIBUTE_DEPRECATED macro to [[deprecated]]
The LLVM_ATTRIBUTE_DEPRECATED macro marks e.g. function declarations as deprecated. C++14 introduced the [[deprecated]] attribute, and I would like to switch LLVM's code to that because it's portable, easier to read, and can be applied to inline functions as well. https://reviews.llvm.org/D94219 is the first step towards that by changing the LLVM_ATTRIBUTE_DEPRECATED implementation from __attribute__/__declspec to [[deprecated]]. In a follow-up change, I will switch the call sites to use [[deprecated]] directly and finally remove the macro. Are there any downsides that I'm missing or any objections? Thanks! Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210108/e8ef9009/attachment.html>
Fangrui Song via llvm-dev
2021-Jan-08 18:29 UTC
[llvm-dev] Change LLVM_ATTRIBUTE_DEPRECATED macro to [[deprecated]]
On 2021-01-08, Christian Sigg via llvm-dev wrote:>The LLVM_ATTRIBUTE_DEPRECATED macro marks e.g. function declarations as >deprecated. > >C++14 introduced the [[deprecated]] attribute, and I would like to switch >LLVM's code to that because it's portable, easier to read, and can be >applied to inline functions as well. > >https://reviews.llvm.org/D94219 is the first step towards that by changing >the LLVM_ATTRIBUTE_DEPRECATED implementation from __attribute__/__declspec > to [[deprecated]]. In a follow-up change, I will switch the call sites to >use [[deprecated]] directly and finally remove the macro. > >Are there any downsides that I'm missing or any objections? > >Thanks! ChristianSounds good. D94219 as the first step is also safer: if some supported compilers have problems, we can catch the problem without causing churn to use sites.
Chris Tetreault via llvm-dev
2021-Jan-08 19:48 UTC
[llvm-dev] Change LLVM_ATTRIBUTE_DEPRECATED macro to [[deprecated]]
One potential issue is the possible existence of compilers that claim to support C++14, but are not fully compliant. I don’t know offhand of any examples of “C++14 compliant” compilers that don’t support [[deprecated]] but it may be worth looking into if any mainstream compilers have this problem. Assuming such a compiler exists, and we care about it, the macro has the advantage that it can be made to be portable. That issue aside, since we require C++14 in CMake, then I think it’s fine to move forward with this. Thanks, Christopher Tetreault From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Christian Sigg via llvm-dev Sent: Friday, January 8, 2021 3:06 AM To: llvm-dev at lists.llvm.org Subject: [EXT] [llvm-dev] Change LLVM_ATTRIBUTE_DEPRECATED macro to [[deprecated]] The LLVM_ATTRIBUTE_DEPRECATED macro marks e.g. function declarations as deprecated. C++14 introduced the [[deprecated]] attribute, and I would like to switch LLVM's code to that because it's portable, easier to read, and can be applied to inline functions as well. https://reviews.llvm.org/D94219 is the first step towards that by changing the LLVM_ATTRIBUTE_DEPRECATED implementation from __attribute__/__declspec to [[deprecated]]. In a follow-up change, I will switch the call sites to use [[deprecated]] directly and finally remove the macro. Are there any downsides that I'm missing or any objections? Thanks! Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210108/5afe0237/attachment.html>
Stephen Kelly via llvm-dev
2021-Jan-08 22:12 UTC
[llvm-dev] Change LLVM_ATTRIBUTE_DEPRECATED macro to [[deprecated]]
On 08/01/2021 11:05, Christian Sigg via llvm-dev wrote:> The LLVM_ATTRIBUTE_DEPRECATED macro marks e.g. function declarations as > deprecated. > > C++14 introduced the [[deprecated]] attribute, and I would like to > switch LLVM's code to that because it's portable, easier to read, and > can be applied to inline functions as well. > > https://reviews.llvm.org/D94219 is the first step towards that by > changing the LLVM_ATTRIBUTE_DEPRECATED implementation from > __attribute__/__declspec to [[deprecated]]. In a follow-up change, I > will switch the call sites to use [[deprecated]] directly and finally > remove the macro. > > Are there any downsides that I'm missing or any objections?The only downside I'm aware of is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96117 I don't think the llvm build uses export macros, but are there any places where different attribute types are used? Thanks, Stephen.