Skip to content

Commit 7d9a2c7

Browse files
committed
Remove the NotUnderValgrind caching flag
The motivation for this caching wasn't clear, remove it in an effort to simplify the code and make libSupport free of global dynamic constructor. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D106206
1 parent c2dacb1 commit 7d9a2c7

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

llvm/lib/Support/Valgrind.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,11 @@
1919
#if HAVE_VALGRIND_VALGRIND_H
2020
#include <valgrind/valgrind.h>
2121

22-
static bool InitNotUnderValgrind() {
23-
return !RUNNING_ON_VALGRIND;
24-
}
25-
26-
// This bool is negated from what we'd expect because code may run before it
27-
// gets initialized. If that happens, it will appear to be 0 (false), and we
28-
// want that to cause the rest of the code in this file to run the
29-
// Valgrind-provided macros.
30-
static const bool NotUnderValgrind = InitNotUnderValgrind();
31-
3222
bool llvm::sys::RunningOnValgrind() {
33-
if (NotUnderValgrind)
34-
return false;
3523
return RUNNING_ON_VALGRIND;
3624
}
3725

3826
void llvm::sys::ValgrindDiscardTranslations(const void *Addr, size_t Len) {
39-
if (NotUnderValgrind)
40-
return;
41-
4227
VALGRIND_DISCARD_TRANSLATIONS(Addr, Len);
4328
}
4429

0 commit comments

Comments
 (0)