tsan: add SANITIZER_INTERFACE_ATTRIBUTE to more callbacks

so that it's possible to override them from a dynamic library.

llvm-svn: 200747
This commit is contained in:
Dmitry Vyukov 2014-02-04 08:46:09 +00:00
parent d23c79604e
commit fd0affac37
2 changed files with 4 additions and 1 deletions

View File

@ -27,7 +27,8 @@ Flags *flags() {
#ifdef TSAN_EXTERNAL_HOOKS
extern "C" const char* __tsan_default_options();
#else
extern "C" const char *WEAK __tsan_default_options() {
extern "C" SANITIZER_INTERFACE_ATTRIBUTE
const char *WEAK __tsan_default_options() {
return "";
}
#endif

View File

@ -43,9 +43,11 @@ static char ctx_placeholder[sizeof(Context)] ALIGNED(64);
bool OnFinalize(bool failed);
void OnInitialize();
#else
SANITIZER_INTERFACE_ATTRIBUTE
bool WEAK OnFinalize(bool failed) {
return failed;
}
SANITIZER_INTERFACE_ATTRIBUTE
void WEAK OnInitialize() {}
#endif