This is an archive of the discontinued LLVM Phabricator instance.

Turn a config macro (_LIBCPP_HAS_NO_INLINE_VARIABLES) into an attribute macro (_LIBCPP_INLINE_VAR)
AbandonedPublic

Authored by mclow.lists on Dec 14 2017, 7:33 AM.

Details

Reviewers
EricWF
Summary

We're going to be defining a lot of inline variables going forward, and the current way of doing it is ... long-winded.
Add an attribute macro which we can put everywhere we need, and handles the conditional.

Instead of writing

#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
inline
#endif
constexpr in_place_t in_place{};

we can now write:

_LIBCPP_INLINE_VAR constexpr in_place_t in_place{};

(and it gets rid of a FIXME!)

Diff Detail

Event Timeline

mclow.lists created this revision.Dec 14 2017, 7:33 AM

There are no tests because this should not change any functionality.

mclow.lists abandoned this revision.Jan 2 2018, 9:18 AM

This was committed as part of r321658