tsan_interceptors_memintrinsics.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //===-- tsan_interceptors_posix.cpp ---------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file is a part of ThreadSanitizer (TSan), a race detector.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #define SANITIZER_COMMON_NO_REDEFINE_BUILTINS
  13. #include "tsan_interceptors.h"
  14. #include "tsan_interface.h"
  15. using namespace __tsan;
  16. #include "sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc"
  17. extern "C" {
  18. void *__tsan_memcpy(void *dst, const void *src, uptr size) {
  19. void *ctx;
  20. #if PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE
  21. COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx, dst, src, size);
  22. #else
  23. COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, dst, src, size);
  24. #endif
  25. }
  26. void *__tsan_memset(void *dst, int c, uptr size) {
  27. void *ctx;
  28. COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, dst, c, size);
  29. }
  30. void *__tsan_memmove(void *dst, const void *src, uptr size) {
  31. void *ctx;
  32. COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, dst, src, size);
  33. }
  34. } // extern "C"