PrintPasses.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- PrintPasses.h - Determining whether/when to print IR ---------------===//
  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. #ifndef LLVM_IR_PRINTPASSES_H
  14. #define LLVM_IR_PRINTPASSES_H
  15. #include "llvm/ADT/StringRef.h"
  16. #include <vector>
  17. namespace llvm {
  18. // Returns true if printing before/after some pass is enabled, whether all
  19. // passes or a specific pass.
  20. bool shouldPrintBeforeSomePass();
  21. bool shouldPrintAfterSomePass();
  22. // Returns true if we should print before/after a specific pass. The argument
  23. // should be the pass ID, e.g. "instcombine".
  24. bool shouldPrintBeforePass(StringRef PassID);
  25. bool shouldPrintAfterPass(StringRef PassID);
  26. // Returns true if we should print before/after all passes.
  27. bool shouldPrintBeforeAll();
  28. bool shouldPrintAfterAll();
  29. // The list of passes to print before/after, if we only want to print
  30. // before/after specific passes.
  31. std::vector<std::string> printBeforePasses();
  32. std::vector<std::string> printAfterPasses();
  33. // Returns true if we should always print the entire module.
  34. bool forcePrintModuleIR();
  35. // Returns true if we should print the function.
  36. bool isFunctionInPrintList(StringRef FunctionName);
  37. } // namespace llvm
  38. #endif // LLVM_IR_PRINTPASSES_H
  39. #ifdef __GNUC__
  40. #pragma GCC diagnostic pop
  41. #endif