Valgrind.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- llvm/Support/Valgrind.h - Communication with Valgrind ----*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // Methods for communicating with a valgrind instance this program is running
  15. // under. These are all no-ops unless LLVM was configured on a system with the
  16. // valgrind headers installed and valgrind is controlling this process.
  17. //
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_SUPPORT_VALGRIND_H
  20. #define LLVM_SUPPORT_VALGRIND_H
  21. #include <cstddef>
  22. namespace llvm {
  23. namespace sys {
  24. // True if Valgrind is controlling this process.
  25. bool RunningOnValgrind();
  26. // Discard valgrind's translation of code in the range [Addr .. Addr + Len).
  27. // Otherwise valgrind may continue to execute the old version of the code.
  28. void ValgrindDiscardTranslations(const void *Addr, size_t Len);
  29. } // namespace sys
  30. } // end namespace llvm
  31. #endif // LLVM_SUPPORT_VALGRIND_H
  32. #ifdef __GNUC__
  33. #pragma GCC diagnostic pop
  34. #endif