forked from OSchip/llvm-project
Turn on -Wunused-function and cleanup occurances
llvm-svn: 296936
This commit is contained in:
parent
0350a87ce3
commit
6aa4f1d1af
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue