tsan: add memory range access functions to public iface

llvm-svn: 168692
This commit is contained in:
Dmitry Vyukov 2012-11-27 08:41:39 +00:00
parent 96c39f733f
commit 210c21129e
2 changed files with 11 additions and 0 deletions

View File

@ -44,6 +44,9 @@ void __tsan_vptr_update(void **vptr_p, void *new_val);
void __tsan_func_entry(void *call_pc);
void __tsan_func_exit();
void __tsan_read_range(void *addr, unsigned long size); // NOLINT
void __tsan_write_range(void *addr, unsigned long size); // NOLINT
#ifdef __cplusplus
} // extern "C"
#endif

View File

@ -63,3 +63,11 @@ void __tsan_func_entry(void *pc) {
void __tsan_func_exit() {
FuncExit(cur_thread());
}
void __tsan_read_range(void *addr, uptr size) {
MemoryAccessRange(cur_thread(), CALLERPC, (uptr)addr, size, false);
}
void __tsan_write_range(void *addr, uptr size) {
MemoryAccessRange(cur_thread(), CALLERPC, (uptr)addr, size, true);
}