[PATCH] D106206: Remove the NotUnderValgrind caching flag

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 14:30:09 PDT 2021


dexonsmith accepted this revision.
dexonsmith added a comment.
This revision is now accepted and ready to land.

Updated patch LGTM, with a couple of nits inline.

(Agreed that it'd be great for Julia to write a test for the LLVM JIT that confirms it behaves correctly under Valgrind.)



================
Comment at: llvm/lib/Support/Valgrind.cpp:17
 #include "llvm/Config/config.h"
+#include "llvm/Support/ManagedStatic.h"
 #include <cstddef>
----------------
You can drop this now.


================
Comment at: llvm/lib/Support/Valgrind.cpp:23
 
-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() {
   return RUNNING_ON_VALGRIND;
----------------
Probably clang-format will want to delete some newlines here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106206/new/

https://reviews.llvm.org/D106206



More information about the llvm-commits mailing list