1 //===- PrintPasses.h - Determining whether/when to print IR ---------------===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_IR_PRINTPASSES_H
10 #define LLVM_IR_PRINTPASSES_H
12 #include "llvm/ADT/StringRef.h"
17 // Returns true if printing before/after some pass is enabled, whether all
18 // passes or a specific pass.
19 bool shouldPrintBeforeSomePass();
20 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);
27 // Returns true if we should print before/after all passes.
28 bool shouldPrintBeforeAll();
29 bool shouldPrintAfterAll();
31 // The list of passes to print before/after, if we only want to print
32 // before/after specific passes.
33 std::vector<std::string> printBeforePasses();
34 std::vector<std::string> printAfterPasses();
36 // Returns true if we should always print the entire module.
37 bool forcePrintModuleIR();
39 // Returns true if we should print the function.
40 bool isFunctionInPrintList(StringRef FunctionName);
44 #endif // LLVM_IR_PRINTPASSES_H