Skip to content

Commit bcbbe1d

Browse files
committed
[lsan] remove LeakSanitizerIsTurnedOffForTheCurrentProcess (this was a bad idea), leave __lsan_is_turned_off
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199304 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 759be17 commit bcbbe1d

File tree

4 files changed

+2
-18
lines changed

4 files changed

+2
-18
lines changed

include/sanitizer/lsan_interface.h

-5
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ extern "C" {
5353
// for the program it is linked into (if the return value is non-zero). This
5454
// function must be defined as returning a constant value; any behavior beyond
5555
// that is unsupported.
56-
int LeakSanitizerIsTurnedOffForTheCurrentProcess();
57-
58-
// Same as LeakSanitizerIsTurnedOffForTheCurrentProcess, but deprecated.
59-
// If both functions are defined only
60-
// LeakSanitizerIsTurnedOffForTheCurrentProcess is used.
6156
int __lsan_is_turned_off();
6257

6358
// This function may be optionally provided by the user and should return

lib/lsan/lit_tests/TestCases/link_turned_off.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
int argc_copy;
1010

1111
extern "C" {
12-
int LeakSanitizerIsTurnedOffForTheCurrentProcess() {
12+
int __lsan_is_turned_off() {
1313
return (argc_copy == 1);
1414
}
1515
}

lib/lsan/lsan_common.cc

+1-10
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,8 @@ void DoLeakCheck() {
423423
static bool already_done;
424424
if (already_done) return;
425425
already_done = true;
426-
if (&LeakSanitizerIsTurnedOffForTheCurrentProcess) {
427-
if (LeakSanitizerIsTurnedOffForTheCurrentProcess())
426+
if (&__lsan_is_turned_off && __lsan_is_turned_off())
428427
return;
429-
} else if (&__lsan_is_turned_off) {
430-
if (__lsan_is_turned_off())
431-
return;
432-
}
433428

434429
DoLeakCheckParam param;
435430
param.success = false;
@@ -719,9 +714,5 @@ SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
719714
int __lsan_is_turned_off() {
720715
return 0;
721716
}
722-
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
723-
int LeakSanitizerIsTurnedOffForTheCurrentProcess() {
724-
return 0;
725-
}
726717
#endif
727718
} // extern "C"

lib/lsan/lsan_common.h

-2
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ class LsanMetadata {
199199
extern "C" {
200200
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
201201
int __lsan_is_turned_off();
202-
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
203-
int LeakSanitizerIsTurnedOffForTheCurrentProcess();
204202

205203
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
206204
const char *__lsan_default_suppressions();

0 commit comments

Comments
 (0)