forked from OSchip/llvm-project
tsan: add a flag to control RunningOnValgrind() return value
llvm-svn: 157383
This commit is contained in:
parent
26dcb95dfc
commit
65c21a5e6d
|
@ -49,6 +49,8 @@ void InitializeFlags(Flags *f, const char *env) {
|
|||
f->profile_memory = "";
|
||||
f->flush_memory_ms = 0;
|
||||
f->stop_on_start = false;
|
||||
f->running_on_valgrind = false;
|
||||
|
||||
|
||||
// Let a frontend override.
|
||||
OverrideFlags(f);
|
||||
|
|
|
@ -52,6 +52,8 @@ struct Flags {
|
|||
int flush_memory_ms;
|
||||
// Stops on start until __tsan_resume() is called (for debugging).
|
||||
bool stop_on_start;
|
||||
// Controls whether RunningOnValgrind() returns true or false.
|
||||
bool running_on_valgrind;
|
||||
};
|
||||
|
||||
Flags *flags();
|
||||
|
|
|
@ -332,7 +332,7 @@ void WTFAnnotateBenignRaceSized(char *f, int l, uptr mem, uptr sz, char *desc) {
|
|||
}
|
||||
|
||||
int RunningOnValgrind() {
|
||||
return 0;
|
||||
return flags()->running_on_valgrind;
|
||||
}
|
||||
|
||||
double __attribute__((weak)) ValgrindSlowdown(void) {
|
||||
|
|
Loading…
Reference in New Issue