[libc++] Run clang-tidy in all configurations that are run in the Docker container

Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D143333
This commit is contained in:
Nikolas Klauser 2023-02-05 11:09:23 +01:00
parent 2c1433453d
commit 4668dd8c4a
5 changed files with 47 additions and 11 deletions

View File

@ -78,7 +78,7 @@ _LIBCPP_HIDE_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_impl<_Tp> const
template <class _Atp, class _Fn>
_LIBCPP_HIDE_FROM_ABI bool __cxx_atomic_wait(_Atp*, _Fn && __test_fn)
{
return __libcpp_thread_poll_with_backoff(__test_fn, __spinning_backoff_policy());
return std::__libcpp_thread_poll_with_backoff(__test_fn, __spinning_backoff_policy());
}
#endif // _LIBCPP_HAS_NO_THREADS

View File

@ -98,8 +98,8 @@ _C_node<_Cont>::__dereferenceable(const void* __i) const
{
typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i);
_Cont* _Cp = static_cast<_Cont*>(__c_);
return _Cp->__dereferenceable(__j);
_Cont* __cp = static_cast<_Cont*>(__c_);
return __cp->__dereferenceable(__j);
}
template <class _Cont>
@ -108,8 +108,8 @@ _C_node<_Cont>::__decrementable(const void* __i) const
{
typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i);
_Cont* _Cp = static_cast<_Cont*>(__c_);
return _Cp->__decrementable(__j);
_Cont* __cp = static_cast<_Cont*>(__c_);
return __cp->__decrementable(__j);
}
template <class _Cont>
@ -118,8 +118,8 @@ _C_node<_Cont>::__addable(const void* __i, ptrdiff_t __n) const
{
typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i);
_Cont* _Cp = static_cast<_Cont*>(__c_);
return _Cp->__addable(__j, __n);
_Cont* __cp = static_cast<_Cont*>(__c_);
return __cp->__addable(__j, __n);
}
template <class _Cont>
@ -128,8 +128,8 @@ _C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const
{
typedef typename _Cont::const_iterator iterator;
const iterator* __j = static_cast<const iterator*>(__i);
_Cont* _Cp = static_cast<_Cont*>(__c_);
return _Cp->__subscriptable(__j, __n);
_Cont* __cp = static_cast<_Cont*>(__c_);
return __cp->__subscriptable(__j, __n);
}
class _LIBCPP_TYPE_VIS __libcpp_db

View File

@ -375,7 +375,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
{
_LIBCPP_ASSERT(__root != nullptr, "Root node should not be null");
_LIBCPP_ASSERT(__z != nullptr, "The node to remove should not be null");
_LIBCPP_DEBUG_ASSERT(__tree_invariant(__root), "The tree invariants should hold");
_LIBCPP_DEBUG_ASSERT(std::__tree_invariant(__root), "The tree invariants should hold");
// __z will be removed from the tree. Client still needs to destruct/deallocate it
// __y is either __z, or if __z has two children, __tree_next(__z).
// __y will have at most one child.

View File

@ -45,7 +45,16 @@ target_include_directories(clangTidy INTERFACE
${CLANG_INCLUDE_DIRS}
${LLVM_INCLUDE_DIRS}
)
target_compile_options(clangTidy INTERFACE -fno-rtti)
target_compile_options(clangTidy INTERFACE
-fno-rtti
-fno-sanitize=address,hwaddress,undefined,thread,leak # ignore any sanitizers
)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(clangTidy INTERFACE
-fno-sanitize=memory,dataflow
)
endif()
add_library(cxx-tidy MODULE ${SOURCES})
target_link_libraries(cxx-tidy clangTidy)

View File

@ -97,6 +97,7 @@ steps:
env:
CC: "gcc-${GCC_STABLE_VERSION}"
CXX: "g++-${GCC_STABLE_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -132,6 +133,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -245,6 +247,7 @@ steps:
env:
CC: "gcc-${GCC_STABLE_VERSION}"
CXX: "g++-${GCC_STABLE_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -262,6 +265,8 @@ steps:
env:
CC: "clang-15"
CXX: "clang++-15"
# TODO LLVM18: Enable clang-tidy
# ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -279,6 +284,7 @@ steps:
env:
CC: "clang-16"
CXX: "clang++-16"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -299,6 +305,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -316,6 +323,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -333,6 +341,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -350,6 +359,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -389,6 +399,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -406,6 +417,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -423,6 +435,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -440,6 +453,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -457,6 +471,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -474,6 +489,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -493,6 +509,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -510,6 +527,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -527,6 +545,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -544,6 +563,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -561,6 +581,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -578,6 +599,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -595,6 +617,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -612,6 +635,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -629,6 +653,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -646,6 +671,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"
@ -664,6 +690,7 @@ steps:
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"
os: "linux"