1*9880d681SAndroid Build Coastguard Worker //===- llvm/Support/Valgrind.h - Communication with Valgrind ----*- C++ -*-===// 2*9880d681SAndroid Build Coastguard Worker // 3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure 4*9880d681SAndroid Build Coastguard Worker // 5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source 6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details. 7*9880d681SAndroid Build Coastguard Worker // 8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 9*9880d681SAndroid Build Coastguard Worker // 10*9880d681SAndroid Build Coastguard Worker // Methods for communicating with a valgrind instance this program is running 11*9880d681SAndroid Build Coastguard Worker // under. These are all no-ops unless LLVM was configured on a system with the 12*9880d681SAndroid Build Coastguard Worker // valgrind headers installed and valgrind is controlling this process. 13*9880d681SAndroid Build Coastguard Worker // 14*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 15*9880d681SAndroid Build Coastguard Worker 16*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_SUPPORT_VALGRIND_H 17*9880d681SAndroid Build Coastguard Worker #define LLVM_SUPPORT_VALGRIND_H 18*9880d681SAndroid Build Coastguard Worker 19*9880d681SAndroid Build Coastguard Worker #include <cstddef> 20*9880d681SAndroid Build Coastguard Worker 21*9880d681SAndroid Build Coastguard Worker namespace llvm { 22*9880d681SAndroid Build Coastguard Worker namespace sys { 23*9880d681SAndroid Build Coastguard Worker // True if Valgrind is controlling this process. 24*9880d681SAndroid Build Coastguard Worker bool RunningOnValgrind(); 25*9880d681SAndroid Build Coastguard Worker 26*9880d681SAndroid Build Coastguard Worker // Discard valgrind's translation of code in the range [Addr .. Addr + Len). 27*9880d681SAndroid Build Coastguard Worker // Otherwise valgrind may continue to execute the old version of the code. 28*9880d681SAndroid Build Coastguard Worker void ValgrindDiscardTranslations(const void *Addr, size_t Len); 29*9880d681SAndroid Build Coastguard Worker } // namespace sys 30*9880d681SAndroid Build Coastguard Worker } // end namespace llvm 31*9880d681SAndroid Build Coastguard Worker 32*9880d681SAndroid Build Coastguard Worker #endif // LLVM_SUPPORT_VALGRIND_H 33