summaryrefslogtreecommitdiffstats
path: root/libcxx/include/experimental/coroutine
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-01-16 01:51:12 +0000
committerEric Fiselier <eric@efcs.ca>2019-01-16 01:51:12 +0000
commitd108bf85b09e3f1355fea866d90e3dd2266d67b5 (patch)
treebedceef58ed8c43730f187f8adfffc4fcf38881b /libcxx/include/experimental/coroutine
parentac855d3ea9cb53f8c34422f3ce43ac41113f6b7f (diff)
downloadbcm5719-llvm-d108bf85b09e3f1355fea866d90e3dd2266d67b5.tar.gz
bcm5719-llvm-d108bf85b09e3f1355fea866d90e3dd2266d67b5.zip
Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`.
Summary: Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See llvm.org/PR39713 This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used. This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement. I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. Reviewers: ldionne, EricWF Reviewed By: ldionne, EricWF Subscribers: jyknight, christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D54814 llvm-svn: 351289
Diffstat (limited to 'libcxx/include/experimental/coroutine')
-rw-r--r--libcxx/include/experimental/coroutine6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/include/experimental/coroutine b/libcxx/include/experimental/coroutine
index 1eb224a535a..7cb39b81b48 100644
--- a/libcxx/include/experimental/coroutine
+++ b/libcxx/include/experimental/coroutine
@@ -214,7 +214,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
_Promise& promise() const {
return *static_cast<_Promise*>(
- __builtin_coro_promise(this->__handle_, __alignof(_Promise), false));
+ __builtin_coro_promise(this->__handle_, _LIBCPP_ALIGNOF(_Promise), false));
}
public:
@@ -254,7 +254,7 @@ public:
coroutine_handle __tmp;
__tmp.__handle_ = __builtin_coro_promise(
_VSTD::addressof(const_cast<_RawPromise&>(__promise)),
- __alignof(_Promise), true);
+ _LIBCPP_ALIGNOF(_Promise), true);
return __tmp;
}
};
@@ -272,7 +272,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
_Promise& promise() const {
return *static_cast<_Promise*>(
- __builtin_coro_promise(this->__handle_, __alignof(_Promise), false));
+ __builtin_coro_promise(this->__handle_, _LIBCPP_ALIGNOF(_Promise), false));
}
_LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return true; }
OpenPOWER on IntegriCloud