summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2020-02-01 13:32:57 +0200
committerHans Wennborg <hans@chromium.org>2020-02-04 10:56:52 +0100
commit165a6367631d643f8f186d7a809013652cf321d6 (patch)
treecd67384c20aa2b7bd21bfca6cb2c74f8d7da5939
parentd2a710ea784eea43c63e3831224de6355f1e4a6f (diff)
downloadbcm5719-llvm-165a6367631d643f8f186d7a809013652cf321d6.tar.gz
bcm5719-llvm-165a6367631d643f8f186d7a809013652cf321d6.zip
[libcxxabi] Fix layout of __cxa_exception for win64
Win64 isn't LP64, it's LLP64, but there's no __LLP64__ predefined - just check _WIN64 in addition to __LP64__. This fixes compilation after static asserts about the struct layout were added in f2a436058fcbc11291e73badb44e243f61046183. Differential Revision: https://reviews.llvm.org/D73838 (cherry picked from commit 09dc884eb2e4a433eb8c5ed20a17108091279295)
-rw-r--r--libcxxabi/src/cxa_exception.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libcxxabi/src/cxa_exception.h b/libcxxabi/src/cxa_exception.h
index 7e3a19fe221..8c6c8bca853 100644
--- a/libcxxabi/src/cxa_exception.h
+++ b/libcxxabi/src/cxa_exception.h
@@ -28,7 +28,7 @@ _LIBCXXABI_HIDDEN void __setExceptionClass ( _Unwind_Exception*, uint6
_LIBCXXABI_HIDDEN bool __isOurExceptionClass(const _Unwind_Exception*);
struct _LIBCXXABI_HIDDEN __cxa_exception {
-#if defined(__LP64__) || defined(_LIBCXXABI_ARM_EHABI)
+#if defined(__LP64__) || defined(_WIN64) || defined(_LIBCXXABI_ARM_EHABI)
// Now _Unwind_Exception is marked with __attribute__((aligned)),
// which implies __cxa_exception is also aligned. Insert padding
// in the beginning of the struct, rather than before unwindHeader.
@@ -62,7 +62,7 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {
void *adjustedPtr;
#endif
-#if !defined(__LP64__) && !defined(_LIBCXXABI_ARM_EHABI)
+#if !defined(__LP64__) && !defined(_WIN64) && !defined(_LIBCXXABI_ARM_EHABI)
// This is a new field to support C++ 0x exception_ptr.
// For binary compatibility it is placed where the compiler
// previously adding padded to 64-bit align unwindHeader.
@@ -75,7 +75,7 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {
// The layout of this structure MUST match the layout of __cxa_exception, with
// primaryException instead of referenceCount.
struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {
-#if defined(__LP64__) || defined(_LIBCXXABI_ARM_EHABI)
+#if defined(__LP64__) || defined(_WIN64) || defined(_LIBCXXABI_ARM_EHABI)
void* reserve; // padding.
void* primaryException;
#endif
@@ -100,7 +100,7 @@ struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {
void *adjustedPtr;
#endif
-#if !defined(__LP64__) && !defined(_LIBCXXABI_ARM_EHABI)
+#if !defined(__LP64__) && !defined(_WIN64) && !defined(_LIBCXXABI_ARM_EHABI)
void* primaryException;
#endif
_Unwind_Exception unwindHeader;
@@ -125,7 +125,7 @@ static_assert(offsetof(__cxa_dependent_exception, propagationCount) +
sizeof(_Unwind_Exception) + sizeof(void*) ==
sizeof(__cxa_dependent_exception),
"propagationCount has wrong negative offset");
-#elif defined(__LP64__)
+#elif defined(__LP64__) || defined(_WIN64)
static_assert(offsetof(__cxa_exception, adjustedPtr) +
sizeof(_Unwind_Exception) + sizeof(void*) ==
sizeof(__cxa_exception),
OpenPOWER on IntegriCloud