1 //===- llvm/Support/Valgrind.h - Communication with Valgrind -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Methods for communicating with a valgrind instance this program is running
11 // under. These are all no-ops unless LLVM was configured on a system with the
12 // valgrind headers installed and valgrind is controlling this process.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_SUPPORT_VALGRIND_H
17 #define LLVM_SUPPORT_VALGRIND_H
19 #include "llvm/Config/llvm-config.h"
20 #include "llvm/Support/Compiler.h"
25 // True if Valgrind is controlling this process.
26 bool RunningOnValgrind();
28 // Discard valgrind's translation of code in the range [Addr .. Addr + Len).
29 // Otherwise valgrind may continue to execute the old version of the code.
30 void ValgrindDiscardTranslations(const void *Addr, size_t Len);