EntryExitInstrumenter.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- EntryExitInstrumenter.h - Function Entry/Exit Instrumentation ------===//
  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. // EntryExitInstrumenter pass - Instrument function entry/exit with calls to
  15. // mcount(), @__cyg_profile_func_{enter,exit} and the like. There are two
  16. // variants, intended to run pre- and post-inlining, respectively.
  17. //
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_TRANSFORMS_UTILS_ENTRYEXITINSTRUMENTER_H
  20. #define LLVM_TRANSFORMS_UTILS_ENTRYEXITINSTRUMENTER_H
  21. #include "llvm/IR/PassManager.h"
  22. namespace llvm {
  23. class Function;
  24. struct EntryExitInstrumenterPass
  25. : public PassInfoMixin<EntryExitInstrumenterPass> {
  26. EntryExitInstrumenterPass(bool PostInlining) : PostInlining(PostInlining) {}
  27. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
  28. void printPipeline(raw_ostream &OS,
  29. function_ref<StringRef(StringRef)> MapClassName2PassName);
  30. bool PostInlining;
  31. static bool isRequired() { return true; }
  32. };
  33. } // namespace llvm
  34. #endif // LLVM_TRANSFORMS_UTILS_ENTRYEXITINSTRUMENTER_H
  35. #ifdef __GNUC__
  36. #pragma GCC diagnostic pop
  37. #endif