[PATCH] D106206: Remove the NotUnderValgrind caching flag
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 20 14:27:45 PDT 2021
mehdi_amini updated this revision to Diff 360275.
mehdi_amini added a comment.
Remove unused include now
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106206/new/
https://reviews.llvm.org/D106206
Files:
llvm/lib/Support/Valgrind.cpp
Index: llvm/lib/Support/Valgrind.cpp
===================================================================
--- llvm/lib/Support/Valgrind.cpp
+++ llvm/lib/Support/Valgrind.cpp
@@ -19,26 +19,11 @@
#if HAVE_VALGRIND_VALGRIND_H
#include <valgrind/valgrind.h>
-static bool InitNotUnderValgrind() {
- return !RUNNING_ON_VALGRIND;
-}
-
-// This bool is negated from what we'd expect because code may run before it
-// gets initialized. If that happens, it will appear to be 0 (false), and we
-// want that to cause the rest of the code in this file to run the
-// Valgrind-provided macros.
-static const bool NotUnderValgrind = InitNotUnderValgrind();
-
bool llvm::sys::RunningOnValgrind() {
- if (NotUnderValgrind)
- return false;
return RUNNING_ON_VALGRIND;
}
void llvm::sys::ValgrindDiscardTranslations(const void *Addr, size_t Len) {
- if (NotUnderValgrind)
- return;
-
VALGRIND_DISCARD_TRANSLATIONS(Addr, Len);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106206.360275.patch
Type: text/x-patch
Size: 937 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210720/20cee46f/attachment.bin>
More information about the llvm-commits
mailing list