PrintPasses.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //===- PrintPasses.h - Determining whether/when to print IR ---------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLVM_IR_PRINTPASSES_H
  9. #define LLVM_IR_PRINTPASSES_H
  10. #include "llvm/ADT/StringRef.h"
  11. #include <vector>
  12. namespace llvm {
  13. // Returns true if printing before/after some pass is enabled, whether all
  14. // passes or a specific pass.
  15. bool shouldPrintBeforeSomePass();
  16. bool shouldPrintAfterSomePass();
  17. // Returns true if we should print before/after a specific pass. The argument
  18. // should be the pass ID, e.g. "instcombine".
  19. bool shouldPrintBeforePass(StringRef PassID);
  20. bool shouldPrintAfterPass(StringRef PassID);
  21. // Returns true if we should print before/after all passes.
  22. bool shouldPrintBeforeAll();
  23. bool shouldPrintAfterAll();
  24. // The list of passes to print before/after, if we only want to print
  25. // before/after specific passes.
  26. std::vector<std::string> printBeforePasses();
  27. std::vector<std::string> printAfterPasses();
  28. // Returns true if we should always print the entire module.
  29. bool forcePrintModuleIR();
  30. // Returns true if we should print the function.
  31. bool isFunctionInPrintList(StringRef FunctionName);
  32. } // namespace llvm
  33. #endif // LLVM_IR_PRINTPASSES_H