Add _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM] macros.

This patch refactors the compiler detection done in `__config` by creating a
set of `_LIBCPP_COMPILER_<TYPE>` macros. The goal of this patch is to make
it easier to detect what compiler is being used outside of `__config`.

Additionally this patch removes workarounds for GCC in `__bit_reference`. I
tested GCC 4.8 and 4.9 without the workaround and neither seemed to need it
anymore.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291286 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-01-06 21:42:58 +00:00
parent 8eb066a106
commit 5170d7d88f
5 changed files with 32 additions and 32 deletions

View File

@@ -40,11 +40,8 @@ class __bit_reference
__storage_pointer __seg_;
__storage_type __mask_;
#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC)
friend typename _Cp::__self;
#else
friend class _Cp::__self;
#endif
friend class __bit_const_reference<_Cp>;
friend class __bit_iterator<_Cp, false>;
public:
@@ -130,11 +127,7 @@ class __bit_const_reference
__storage_pointer __seg_;
__storage_type __mask_;
#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC)
friend typename _Cp::__self;
#else
friend class _Cp::__self;
#endif
friend class __bit_iterator<_Cp, true>;
public:
_LIBCPP_INLINE_VISIBILITY
@@ -1221,11 +1214,8 @@ private:
__bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT
: __seg_(__s), __ctz_(__ctz) {}
#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC)
friend typename _Cp::__self;
#else
friend class _Cp::__self;
#endif
friend class __bit_reference<_Cp>;
friend class __bit_const_reference<_Cp>;
friend class __bit_iterator<_Cp, true>;