Tell Valgrind when we modify already-executed machine code so it knows
to re-instrument the code.  We depend on the system valgrind.h to
avoid adding a new license.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98529 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/System/Memory.cpp b/lib/System/Memory.cpp
index e2d838d..ef23b8d 100644
--- a/lib/System/Memory.cpp
+++ b/lib/System/Memory.cpp
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/System/Memory.h"
+#include "llvm/System/Valgrind.h"
 #include "llvm/Config/config.h"
 
 namespace llvm {
@@ -68,4 +69,6 @@
 #  endif
 
 #endif  // end apple
+
+  ValgrindDiscardTranslations(Addr, Len);
 }