1309124Sdim//===- llvm/Support/Valgrind.h - Communication with Valgrind ----*- C++ -*-===// 2218885Sdim// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6218885Sdim// 7218885Sdim//===----------------------------------------------------------------------===// 8218885Sdim// 9218885Sdim// Methods for communicating with a valgrind instance this program is running 10218885Sdim// under. These are all no-ops unless LLVM was configured on a system with the 11218885Sdim// valgrind headers installed and valgrind is controlling this process. 12218885Sdim// 13218885Sdim//===----------------------------------------------------------------------===// 14218885Sdim 15261991Sdim#ifndef LLVM_SUPPORT_VALGRIND_H 16261991Sdim#define LLVM_SUPPORT_VALGRIND_H 17218885Sdim 18309124Sdim#include <cstddef> 19218885Sdim 20218885Sdimnamespace llvm { 21218885Sdimnamespace sys { 22218885Sdim // True if Valgrind is controlling this process. 23218885Sdim bool RunningOnValgrind(); 24218885Sdim 25218885Sdim // Discard valgrind's translation of code in the range [Addr .. Addr + Len). 26218885Sdim // Otherwise valgrind may continue to execute the old version of the code. 27218885Sdim void ValgrindDiscardTranslations(const void *Addr, size_t Len); 28309124Sdim} // namespace sys 29309124Sdim} // end namespace llvm 30218885Sdim 31309124Sdim#endif // LLVM_SUPPORT_VALGRIND_H 32