]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/lib/esan/esan.h
1 //===-- esan.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 // Main internal esan header file.
15 // - C++ run-time should not be used (static CTORs, RTTI, exceptions, static
16 // function-scope locals)
17 // - All functions/classes/etc reside in namespace __esan, except for those
18 // declared in esan_interface_internal.h.
19 // - Platform-specific files should be used instead of ifdefs (*).
20 // - No system headers included in header files (*).
21 // - Platform specific headers included only into platform-specific files (*).
23 // (*) Except when inlining is critical for performance.
24 //===----------------------------------------------------------------------===//
29 #include "interception/interception.h"
30 #include "sanitizer_common/sanitizer_common.h"
31 #include "esan_interface_internal.h"
35 extern bool EsanIsInitialized
;
36 extern bool EsanDuringInit
;
38 void initializeLibrary(ToolType Tool
);
39 int finalizeLibrary();
41 // Esan creates the variable per tool per compilation unit at compile time
42 // and passes its pointer Ptr to the runtime library.
43 void processCompilationUnitInit(void *Ptr
);
44 void processCompilationUnitExit(void *Ptr
);
45 void processRangeAccess(uptr PC
, uptr Addr
, int Size
, bool IsWrite
);
46 void initializeInterceptors();
48 // Platform-dependent routines.
49 void verifyAddressSpace();
50 bool fixMmapAddr(void **Addr
, SIZE_T Size
, int Flags
);
51 uptr
checkMmapResult(uptr Addr
, SIZE_T Size
);
52 // The return value indicates whether to call the real version or not.
53 bool processSignal(int SigNum
, void (*Handler
)(int), void (**Result
)(int));
54 bool processSigaction(int SigNum
, const void *Act
, void *OldAct
);
55 bool processSigprocmask(int How
, void *Set
, void *OldSet
);