[PATCH] D106206: Remove the NotUnderValgrind caching flag

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 25 17:25:42 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7d9a2c714c4c: Remove the NotUnderValgrind caching flag (authored by mehdi_amini).

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.361563.patch
Type: text/x-patch
Size: 937 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210726/bd3fd48a/attachment.bin>


More information about the llvm-commits mailing list