1353944Sdim//===-- asan_interceptors_memintrinsics.cpp -------------------------------===//
2353944Sdim//
3353944Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353944Sdim// See https://llvm.org/LICENSE.txt for license information.
5353944Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6353944Sdim//
7353944Sdim//===---------------------------------------------------------------------===//
8353944Sdim//
9353944Sdim// This file is a part of AddressSanitizer, an address sanity checker.
10353944Sdim//
11353944Sdim// ASan versions of memcpy, memmove, and memset.
12353944Sdim//===---------------------------------------------------------------------===//
13353944Sdim
14353944Sdim#include "asan_interceptors_memintrinsics.h"
15353944Sdim#include "asan_report.h"
16353944Sdim#include "asan_stack.h"
17353944Sdim#include "asan_suppressions.h"
18353944Sdim
19353944Sdimusing namespace __asan;
20353944Sdim
21353944Sdimvoid *__asan_memcpy(void *to, const void *from, uptr size) {
22353944Sdim  ASAN_MEMCPY_IMPL(nullptr, to, from, size);
23353944Sdim}
24353944Sdim
25353944Sdimvoid *__asan_memset(void *block, int c, uptr size) {
26353944Sdim  ASAN_MEMSET_IMPL(nullptr, block, c, size);
27353944Sdim}
28353944Sdim
29353944Sdimvoid *__asan_memmove(void *to, const void *from, uptr size) {
30353944Sdim  ASAN_MEMMOVE_IMPL(nullptr, to, from, size);
31353944Sdim}
32353944Sdim
33353944Sdim#if SANITIZER_FUCHSIA || SANITIZER_RTEMS
34353944Sdim
35353944Sdim// Fuchsia and RTEMS don't use sanitizer_common_interceptors.inc, but
36353944Sdim// the only things there it wants are these three.  Just define them
37353944Sdim// as aliases here rather than repeating the contents.
38353944Sdim
39353944Sdimextern "C" decltype(__asan_memcpy) memcpy[[gnu::alias("__asan_memcpy")]];
40353944Sdimextern "C" decltype(__asan_memmove) memmove[[gnu::alias("__asan_memmove")]];
41353944Sdimextern "C" decltype(__asan_memset) memset[[gnu::alias("__asan_memset")]];
42353944Sdim
43353944Sdim#endif  // SANITIZER_FUCHSIA || SANITIZER_RTEMS
44