1//===-- copyprof_interface_internal.h -------------------------*- C++ -*-===//
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 declares the internal runtime interface for CopyProf, including
10/// initialization and special member function callback declarations.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef COPYPROF_INTERFACE_INTERNAL_H
15#define COPYPROF_INTERFACE_INTERNAL_H
16
17#include "copyprof_internal.h"
18#include "sanitizer_common/sanitizer_internal_defs.h"
19
20extern "C" {
21
22// Should be called at the very beginning of the process before any instrumented
23// code executes.
24SANITIZER_INTERFACE_ATTRIBUTE void __copyprof_init_once();
25
26// Runtime callbacks that update the CopyProf state machine and shadow memory
27// when entering or leaving special member functions.
28SANITIZER_INTERFACE_ATTRIBUTE void __copyprof_ctor_enter_callback(
29 const void* this_ptr, uptr obj_size);
30SANITIZER_INTERFACE_ATTRIBUTE void __copyprof_ctor_exit_callback(
31 const void* this_ptr, uptr obj_size);
32SANITIZER_INTERFACE_ATTRIBUTE void __copyprof_copy_ctor_enter_callback(
33 const void* this_ptr, const void* other_ptr, uptr obj_size);
34SANITIZER_INTERFACE_ATTRIBUTE void __copyprof_copy_ctor_exit_callback(
35 const void* this_ptr, const void* other_ptr, uptr obj_size);
36SANITIZER_INTERFACE_ATTRIBUTE void __copyprof_copy_assign_op_enter_callback(
37 const void* this_ptr, const void* other_ptr, uptr obj_size);
38SANITIZER_INTERFACE_ATTRIBUTE void __copyprof_copy_assign_op_exit_callback(
39 const void* this_ptr, const void* other_ptr, uptr obj_size);
40SANITIZER_INTERFACE_ATTRIBUTE void __copyprof_dtor_enter_callback(
41 const void* this_ptr, uptr obj_size);
42SANITIZER_INTERFACE_ATTRIBUTE void __copyprof_dtor_exit_callback(
43 const void* this_ptr, uptr obj_size);
44// Store instructions callback that marks memory as not copy.
45SANITIZER_INTERFACE_ATTRIBUTE void __copyprof_store_callback(const void* addr,
46 uptr size);
47
48} // extern "C"
49
50#endif // COPYPROF_INTERFACE_INTERNAL_H
51