Skip to content

[libc++][ASan] Removing clang version checks #71673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -1073,12 +1073,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# ifndef _LIBCPP_HAS_NO_ASAN
extern "C" _LIBCPP_EXPORTED_FROM_ABI void
__sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*);
# if _LIBCPP_CLANG_VER >= 1600
extern "C" _LIBCPP_EXPORTED_FROM_ABI void __sanitizer_annotate_double_ended_contiguous_container(
const void*, const void*, const void*, const void*, const void*, const void*);
extern "C" _LIBCPP_EXPORTED_FROM_ABI int
__sanitizer_verify_double_ended_contiguous_container(const void*, const void*, const void*, const void*);
# endif
# endif

// Try to find out if RTTI is disabled.
Expand Down
9 changes: 1 addition & 8 deletions libcxx/include/__memory/allocator_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,7 @@ struct __is_cpp17_copy_insertable<_Alloc, __enable_if_t<

#ifdef _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS
template <class _Alloc>
struct __asan_annotate_container_with_allocator
# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1600
: true_type {};
# else
// TODO(LLVM-18): Remove the special-casing
: false_type {};
# endif

struct __asan_annotate_container_with_allocator : true_type {};
template <class _Tp>
struct __asan_annotate_container_with_allocator<allocator<_Tp> > : true_type {};
#endif
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/deque
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ public:
// __asan_annotate_container_with_allocator to false.
// For more details, see the "Using libc++" documentation page or
// the documentation for __sanitizer_annotate_contiguous_container.
#if !defined(_LIBCPP_HAS_NO_ASAN) && _LIBCPP_CLANG_VER >= 1600
#if !defined(_LIBCPP_HAS_NO_ASAN)
// TODO LLVM18: Remove the special-casing
_LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container(
const void* __beg,
Expand All @@ -982,7 +982,7 @@ public:
#else
_LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container(
const void*, const void*, const void*, const void*, const void*, const void*) const _NOEXCEPT {}
#endif // !defined(_LIBCPP_HAS_NO_ASAN) && _LIBCPP_CLANG_VER >= 1600
#endif // !defined(_LIBCPP_HAS_NO_ASAN)

_LIBCPP_HIDE_FROM_ABI
void __annotate_from_to(size_type __beg, size_type __end, __asan_annotation_type __annotation_type, __asan_annotation_place __place) const _NOEXCEPT {
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/support/asan_testing.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TEST_CONSTEXPR bool is_contiguous_container_asan_correct ( const std::vector<T,
}
#endif // TEST_HAS_FEATURE(address_sanitizer)

#if TEST_HAS_FEATURE(address_sanitizer) && _LIBCPP_CLANG_VER >= 1600
#if TEST_HAS_FEATURE(address_sanitizer)
extern "C" int __sanitizer_verify_double_ended_contiguous_container(
const void* beg, const void* con_beg, const void* con_end, const void* end);
extern "C" bool __sanitizer_is_annotable(const void* address, const unsigned long size);
Expand Down