Skip to content

Commit 8a454e1

Browse files
authored
[libc++][ASan] Removing clang version checks (#71673)
This commit removes checks like `_LIBCPP_CLANG_VER >= 1600` related to ASan annotations. As only 2 previous versions are supported, it's a TODO for LLVM 18.
1 parent 68d618f commit 8a454e1

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

libcxx/include/__config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,12 +1072,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
10721072
# ifndef _LIBCPP_HAS_NO_ASAN
10731073
extern "C" _LIBCPP_EXPORTED_FROM_ABI void
10741074
__sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*);
1075-
# if _LIBCPP_CLANG_VER >= 1600
10761075
extern "C" _LIBCPP_EXPORTED_FROM_ABI void __sanitizer_annotate_double_ended_contiguous_container(
10771076
const void*, const void*, const void*, const void*, const void*, const void*);
10781077
extern "C" _LIBCPP_EXPORTED_FROM_ABI int
10791078
__sanitizer_verify_double_ended_contiguous_container(const void*, const void*, const void*, const void*);
1080-
# endif
10811079
# endif
10821080

10831081
// Try to find out if RTTI is disabled.

libcxx/include/__memory/allocator_traits.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -408,14 +408,7 @@ struct __is_cpp17_copy_insertable<_Alloc, __enable_if_t<
408408

409409
#ifdef _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS
410410
template <class _Alloc>
411-
struct __asan_annotate_container_with_allocator
412-
# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1600
413-
: true_type {};
414-
# else
415-
// TODO(LLVM-18): Remove the special-casing
416-
: false_type {};
417-
# endif
418-
411+
struct __asan_annotate_container_with_allocator : true_type {};
419412
template <class _Tp>
420413
struct __asan_annotate_container_with_allocator<allocator<_Tp> > : true_type {};
421414
#endif

libcxx/include/deque

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ public:
966966
// __asan_annotate_container_with_allocator to false.
967967
// For more details, see the "Using libc++" documentation page or
968968
// the documentation for __sanitizer_annotate_contiguous_container.
969-
#if !defined(_LIBCPP_HAS_NO_ASAN) && _LIBCPP_CLANG_VER >= 1600
969+
#if !defined(_LIBCPP_HAS_NO_ASAN)
970970
// TODO LLVM18: Remove the special-casing
971971
_LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container(
972972
const void* __beg,
@@ -982,7 +982,7 @@ public:
982982
#else
983983
_LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container(
984984
const void*, const void*, const void*, const void*, const void*, const void*) const _NOEXCEPT {}
985-
#endif // !defined(_LIBCPP_HAS_NO_ASAN) && _LIBCPP_CLANG_VER >= 1600
985+
#endif // !defined(_LIBCPP_HAS_NO_ASAN)
986986

987987
_LIBCPP_HIDE_FROM_ABI
988988
void __annotate_from_to(size_type __beg, size_type __end, __asan_annotation_type __annotation_type, __asan_annotation_place __place) const _NOEXCEPT {

libcxx/test/support/asan_testing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ TEST_CONSTEXPR bool is_contiguous_container_asan_correct ( const std::vector<T,
3434
}
3535
#endif // TEST_HAS_FEATURE(address_sanitizer)
3636

37-
#if TEST_HAS_FEATURE(address_sanitizer) && _LIBCPP_CLANG_VER >= 1600
37+
#if TEST_HAS_FEATURE(address_sanitizer)
3838
extern "C" int __sanitizer_verify_double_ended_contiguous_container(
3939
const void* beg, const void* con_beg, const void* con_end, const void* end);
4040
extern "C" bool __sanitizer_is_annotable(const void* address, const unsigned long size);

0 commit comments

Comments
 (0)