[libcxxabi] r228363 - [libcxxabi] Fix -Werror build for 32-bit non-ARM.
Dan Albert
danalbert at google.com
Thu Feb 5 15:55:15 PST 2015
Author: danalbert
Date: Thu Feb 5 17:55:15 2015
New Revision: 228363
URL: http://llvm.org/viewvc/llvm-project?rev=228363&view=rev
Log:
[libcxxabi] Fix -Werror build for 32-bit non-ARM.
Summary:
The inclusion of Unwind-EHABI.h was insufficiently guarded
(LIBCXXABI_ARM_EHABI was beign checked without ever being defined).
Move the check into the header file itself, add the check to the
source file, and clean up the existing checks.
LIBCXXABI_ARM_EHABI didn't have a canonical defintion; it was
duplicated across cxxabi.h, libunwind.h, and unwind.h. Move the
definition into __cxxabi_config.h and clean up the old cruft (note: we
will have to ship this header).
There are also a few drive-by formatting/whitespace cleanups.
Reviewers: jroelofs, thakis, compnerd
Reviewed By: compnerd
Subscribers: compnerd, aemerson, cfe-commits
Differential Revision: http://reviews.llvm.org/D7419
Added:
libcxxabi/trunk/include/__cxxabi_config.h
Modified:
libcxxabi/trunk/include/cxxabi.h
libcxxabi/trunk/include/libunwind.h
libcxxabi/trunk/include/unwind.h
libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp
libcxxabi/trunk/src/Unwind/Unwind-EHABI.h
libcxxabi/trunk/src/Unwind/UnwindCursor.hpp
libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c
Added: libcxxabi/trunk/include/__cxxabi_config.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/__cxxabi_config.h?rev=228363&view=auto
==============================================================================
--- libcxxabi/trunk/include/__cxxabi_config.h (added)
+++ libcxxabi/trunk/include/__cxxabi_config.h Thu Feb 5 17:55:15 2015
@@ -0,0 +1,20 @@
+//===-------------------------- __cxxabi_config.h -------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef ____CXXABI_CONFIG_H
+#define ____CXXABI_CONFIG_H
+
+#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
+ !defined(__ARM_DWARF_EH__)
+#define LIBCXXABI_ARM_EHABI 1
+#else
+#define LIBCXXABI_ARM_EHABI 0
+#endif
+
+#endif // ____CXXABI_CONFIG_H
Modified: libcxxabi/trunk/include/cxxabi.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/cxxabi.h?rev=228363&r1=228362&r2=228363&view=diff
==============================================================================
--- libcxxabi/trunk/include/cxxabi.h (original)
+++ libcxxabi/trunk/include/cxxabi.h Thu Feb 5 17:55:15 2015
@@ -18,17 +18,11 @@
#include <stddef.h>
#include <stdint.h>
+#include <__cxxabi_config.h>
+
#define _LIBCPPABI_VERSION 1001
#define LIBCXXABI_NORETURN __attribute__((noreturn))
-// FIXME: This is also in unwind.h and libunwind.h, can we consolidate?
-#if !defined(__USING_SJLJ_EXCEPTIONS__) && defined(__arm__) && \
- !defined(__ARM_DWARF_EH__) && !defined(__APPLE__)
-#define LIBCXXABI_ARM_EHABI 1
-#else
-#define LIBCXXABI_ARM_EHABI 0
-#endif
-
#ifdef __cplusplus
namespace std {
Modified: libcxxabi/trunk/include/libunwind.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/libunwind.h?rev=228363&r1=228362&r2=228363&view=diff
==============================================================================
--- libcxxabi/trunk/include/libunwind.h (original)
+++ libcxxabi/trunk/include/libunwind.h Thu Feb 5 17:55:15 2015
@@ -17,13 +17,7 @@
#include <stdint.h>
#include <stddef.h>
-// FIXME: This is also in unwind.h and cxxabi.h, can we consolidate?
-#if !defined(__USING_SJLJ_EXCEPTIONS__) && defined(__arm__) && \
- !defined(__ARM_DWARF_EH__) && !defined(__APPLE__)
-#define LIBCXXABI_ARM_EHABI 1
-#else
-#define LIBCXXABI_ARM_EHABI 0
-#endif
+#include <__cxxabi_config.h>
#ifdef __APPLE__
#include <Availability.h>
Modified: libcxxabi/trunk/include/unwind.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/unwind.h?rev=228363&r1=228362&r2=228363&view=diff
==============================================================================
--- libcxxabi/trunk/include/unwind.h (original)
+++ libcxxabi/trunk/include/unwind.h Thu Feb 5 17:55:15 2015
@@ -23,13 +23,7 @@
#define LIBUNWIND_UNAVAIL
#endif
-// FIXME: This is also in cxxabi.h and libunwind.h, can we consolidate?
-#if !defined(__USING_SJLJ_EXCEPTIONS__) && defined(__arm__) && \
- !defined(__ARM_DWARF_EH__) && !defined(__APPLE__)
-#define LIBCXXABI_ARM_EHABI 1
-#else
-#define LIBCXXABI_ARM_EHABI 0
-#endif
+#include <__cxxabi_config.h>
typedef enum {
_URC_NO_REASON = 0,
@@ -208,9 +202,7 @@ extern _Unwind_VRS_Result
_Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,
uint32_t discriminator,
_Unwind_VRS_DataRepresentation representation);
-#endif
-#if LIBCXXABI_ARM_EHABI
static inline uintptr_t _Unwind_GetGR(struct _Unwind_Context* context,
int index) {
uintptr_t value = 0;
Modified: libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp?rev=228363&r1=228362&r2=228363&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp (original)
+++ libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp Thu Feb 5 17:55:15 2015
@@ -12,7 +12,7 @@
#include "Unwind-EHABI.h"
-#include <unwind.h>
+#if LIBCXXABI_ARM_EHABI
#include <stdbool.h>
#include <stdint.h>
@@ -26,7 +26,6 @@
#include "unwind.h"
#include "../private_typeinfo.h"
-#if LIBCXXABI_ARM_EHABI
namespace {
// Strange order: take words in order, but inside word, take from most to least
Modified: libcxxabi/trunk/src/Unwind/Unwind-EHABI.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/Unwind-EHABI.h?rev=228363&r1=228362&r2=228363&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/Unwind-EHABI.h (original)
+++ libcxxabi/trunk/src/Unwind/Unwind-EHABI.h Thu Feb 5 17:55:15 2015
@@ -11,6 +11,10 @@
#ifndef __UNWIND_EHABI_H__
#define __UNWIND_EHABI_H__
+#include <__cxxabi_config.h>
+
+#if LIBCXXABI_ARM_EHABI
+
#include <stdint.h>
#include <unwind.h>
@@ -44,6 +48,6 @@ extern _Unwind_Reason_Code __aeabi_unwin
} // extern "C"
#endif
-#endif
+#endif // LIBCXXABI_ARM_EHABI
#endif // __UNWIND_EHABI_H__
Modified: libcxxabi/trunk/src/Unwind/UnwindCursor.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/UnwindCursor.hpp?rev=228363&r1=228362&r2=228363&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/UnwindCursor.hpp (original)
+++ libcxxabi/trunk/src/Unwind/UnwindCursor.hpp Thu Feb 5 17:55:15 2015
@@ -23,17 +23,15 @@
#include <mach-o/dyld.h>
#endif
-#include "libunwind.h"
+#include "config.h"
#include "AddressSpace.hpp"
-#include "Registers.hpp"
-#include "DwarfInstructions.hpp"
#include "CompactUnwinder.hpp"
#include "config.h"
-
-#if LIBCXXABI_ARM_EHABI
+#include "DwarfInstructions.hpp"
+#include "libunwind.h"
+#include "Registers.hpp"
#include "Unwind-EHABI.h"
-#endif
namespace libunwind {
Modified: libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c?rev=228363&r1=228362&r2=228363&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c (original)
+++ libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c Thu Feb 5 17:55:15 2015
@@ -16,14 +16,11 @@
#include <stdio.h>
#include <stdlib.h>
-#include "libunwind.h"
-#include "unwind.h"
-#include "libunwind_ext.h"
#include "config.h"
-
-#if LIBCXXABI_ARM_EHABI
+#include "libunwind_ext.h"
+#include "libunwind.h"
#include "Unwind-EHABI.h"
-#endif
+#include "unwind.h"
#if _LIBUNWIND_BUILD_ZERO_COST_APIS
More information about the cfe-commits
mailing list