summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-03-04 01:02:35 +0000
committerEric Fiselier <eric@efcs.ca>2017-03-04 01:02:35 +0000
commit6aa4f1d1af27077ea3ff0ac3f2f1b3bdca2bcc60 (patch)
treeba7529585f9ccd730fccb1b2924c0f7148985201
parent0350a87ce30fac3b7c038ff5417b39ebaf0baf6e (diff)
downloadbcm5719-llvm-6aa4f1d1af27077ea3ff0ac3f2f1b3bdca2bcc60.tar.gz
bcm5719-llvm-6aa4f1d1af27077ea3ff0ac3f2f1b3bdca2bcc60.zip
Turn on -Wunused-function and cleanup occurances
llvm-svn: 296936
-rw-r--r--libcxxabi/CMakeLists.txt2
-rw-r--r--libcxxabi/cmake/config-ix.cmake2
-rw-r--r--libcxxabi/src/cxa_guard.cpp25
3 files changed, 14 insertions, 15 deletions
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 249494dcf83..81d4042cd3a 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -322,7 +322,7 @@ append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WCONVERSION_FLAG -Wconversion)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WMISMATCHED_TAGS_FLAG -Wmismatched-tags)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WMISSING_BRACES_FLAG -Wmissing-braces)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WNEWLINE_EOF_FLAG -Wnewline-eof)
-append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WNO_UNUSED_FUNCTION_FLAG -Wno-unused-function)
+append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WUNUSED_FUNCTION_FLAG -Wunused-function)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WSHADOW_FLAG -Wshadow)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WSHORTEN_64_TO_32_FLAG -Wshorten-64-to-32)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WSIGN_COMPARE_FLAG -Wsign-compare)
diff --git a/libcxxabi/cmake/config-ix.cmake b/libcxxabi/cmake/config-ix.cmake
index 6ac61525c97..8a4ca492e9f 100644
--- a/libcxxabi/cmake/config-ix.cmake
+++ b/libcxxabi/cmake/config-ix.cmake
@@ -12,7 +12,7 @@ check_cxx_compiler_flag(-nodefaultlibs LIBCXXABI_HAS_NODEFAULTLIBS_FLAG)
check_cxx_compiler_flag(-nostdinc++ LIBCXXABI_HAS_NOSTDINCXX_FLAG)
check_cxx_compiler_flag(-Wall LIBCXXABI_HAS_WALL_FLAG)
check_cxx_compiler_flag(-W LIBCXXABI_HAS_W_FLAG)
-check_cxx_compiler_flag(-Wno-unused-function LIBCXXABI_HAS_WNO_UNUSED_FUNCTION_FLAG)
+check_cxx_compiler_flag(-Wunused-function LIBCXXABI_HAS_WUNUSED_FUNCTION_FLAG)
check_cxx_compiler_flag(-Wunused-variable LIBCXXABI_HAS_WUNUSED_VARIABLE_FLAG)
check_cxx_compiler_flag(-Wunused-parameter LIBCXXABI_HAS_WUNUSED_PARAMETER_FLAG)
check_cxx_compiler_flag(-Wstrict-aliasing LIBCXXABI_HAS_WSTRICT_ALIASING_FLAG)
diff --git a/libcxxabi/src/cxa_guard.cpp b/libcxxabi/src/cxa_guard.cpp
index 49f83ede593..f225dbc1049 100644
--- a/libcxxabi/src/cxa_guard.cpp
+++ b/libcxxabi/src/cxa_guard.cpp
@@ -113,9 +113,10 @@ set_lock(uint64_t& x, lock_type y)
typedef bool lock_type;
-inline
-lock_type
-get_lock(uint64_t x)
+#if !defined(__arm__)
+static_assert(std::is_same<guard_type, uint64_t>::value, "");
+
+inline lock_type get_lock(uint64_t x)
{
union
{
@@ -125,9 +126,7 @@ get_lock(uint64_t x)
return f.lock[1] != 0;
}
-inline
-void
-set_lock(uint64_t& x, lock_type y)
+inline void set_lock(uint64_t& x, lock_type y)
{
union
{
@@ -137,10 +136,10 @@ set_lock(uint64_t& x, lock_type y)
f.lock[1] = y;
x = f.guard;
}
+#else // defined(__arm__)
+static_assert(std::is_same<guard_type, uint32_t>::value, "");
-inline
-lock_type
-get_lock(uint32_t x)
+inline lock_type get_lock(uint32_t x)
{
union
{
@@ -150,9 +149,7 @@ get_lock(uint32_t x)
return f.lock[1] != 0;
}
-inline
-void
-set_lock(uint32_t& x, lock_type y)
+inline void set_lock(uint32_t& x, lock_type y)
{
union
{
@@ -163,7 +160,9 @@ set_lock(uint32_t& x, lock_type y)
x = f.guard;
}
-#endif // __APPLE__
+#endif // !defined(__arm__)
+
+#endif // __APPLE__ && !__arm__
} // unnamed namespace
OpenPOWER on IntegriCloud