1 //===-- sanitizer/esan_interface.h ------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of EfficiencySanitizer, a family of performance tuners.
12 // Public interface header.
13 //===----------------------------------------------------------------------===//
14 #ifndef SANITIZER_ESAN_INTERFACE_H
15 #define SANITIZER_ESAN_INTERFACE_H
17 #include <sanitizer/common_interface_defs.h>
19 // We declare our interface routines as weak to allow the user to avoid
20 // ifdefs and instead use this pattern to allow building the same sources
21 // with and without our runtime library:
25 /* selectany is as close to weak as we'll get. */
26 #define COMPILER_RT_WEAK __declspec(selectany)
28 #define COMPILER_RT_WEAK __attribute__((weak))
30 #define COMPILER_RT_WEAK
37 // This function can be called mid-run (or at the end of a run for
38 // a server process that doesn't shut down normally) to request that
39 // data for that point in the run be reported from the tool.
40 void COMPILER_RT_WEAK __esan_report(void);
42 // This function returns the number of samples that the esan tool has collected
43 // to this point. This is useful for testing.
44 unsigned int COMPILER_RT_WEAK __esan_get_sample_count(void);
50 #endif // SANITIZER_ESAN_INTERFACE_H