mirror of
https://github.com/darlinghq/darling-compiler-rt.git
synced 2024-12-04 18:06:26 +00:00
[TSan] Replace __tsan::OverrideFlags with __tsan::OnInitialize
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197014 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3708634597
commit
493d0cf934
@ -25,12 +25,8 @@ Flags *flags() {
|
||||
|
||||
// Can be overriden in frontend.
|
||||
#ifdef TSAN_EXTERNAL_HOOKS
|
||||
void OverrideFlags(Flags *f);
|
||||
extern "C" const char* __tsan_default_options();
|
||||
#else
|
||||
void WEAK OverrideFlags(Flags *f) {
|
||||
(void)f;
|
||||
}
|
||||
extern "C" const char *WEAK __tsan_default_options() {
|
||||
return "";
|
||||
}
|
||||
@ -95,7 +91,6 @@ void InitializeFlags(Flags *f, const char *env) {
|
||||
SetCommonFlagsDefaults(f);
|
||||
|
||||
// Let a frontend override.
|
||||
OverrideFlags(f);
|
||||
ParseFlags(f, __tsan_default_options());
|
||||
ParseCommonFlagsFromString(f, __tsan_default_options());
|
||||
// Override from command line.
|
||||
|
@ -14,12 +14,6 @@
|
||||
#ifndef TSAN_FLAGS_H
|
||||
#define TSAN_FLAGS_H
|
||||
|
||||
// ----------- ATTENTION -------------
|
||||
// ThreadSanitizer user may provide its implementation of weak
|
||||
// symbol __tsan::OverrideFlags(__tsan::Flags). Therefore, this
|
||||
// header may be included in the user code, and shouldn't include
|
||||
// other headers from TSan or common sanitizer runtime.
|
||||
|
||||
#include "sanitizer_common/sanitizer_flags.h"
|
||||
|
||||
namespace __tsan {
|
||||
|
@ -41,10 +41,12 @@ static char ctx_placeholder[sizeof(Context)] ALIGNED(64);
|
||||
// Can be overriden by a front-end.
|
||||
#ifdef TSAN_EXTERNAL_HOOKS
|
||||
bool OnFinalize(bool failed);
|
||||
void OnInitialize();
|
||||
#else
|
||||
bool WEAK OnFinalize(bool failed) {
|
||||
return failed;
|
||||
}
|
||||
void WEAK OnInitialize() {}
|
||||
#endif
|
||||
|
||||
static Context *ctx;
|
||||
@ -231,6 +233,7 @@ void Initialize(ThreadState *thr) {
|
||||
InitializeShadowMemory();
|
||||
#endif
|
||||
InitializeFlags(&ctx->flags, env);
|
||||
OnInitialize();
|
||||
// Setup correct file descriptor for error reports.
|
||||
__sanitizer_set_report_path(flags()->log_path);
|
||||
InitializeSuppressions();
|
||||
|
Loading…
Reference in New Issue
Block a user