LLVM  14.0.0git
PrintPasses.h
Go to the documentation of this file.
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 
9 #ifndef LLVM_IR_PRINTPASSES_H
10 #define LLVM_IR_PRINTPASSES_H
11 
12 #include "llvm/ADT/StringRef.h"
13 #include <vector>
14 
15 namespace llvm {
16 
17 // Returns true if printing before/after some pass is enabled, whether all
18 // passes or a specific pass.
21 
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 
27 // Returns true if we should print before/after all passes.
29 bool shouldPrintAfterAll();
30 
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();
35 
36 // Returns true if we should always print the entire module.
37 bool forcePrintModuleIR();
38 
39 // Returns true if we should print the function.
40 bool isFunctionInPrintList(StringRef FunctionName);
41 
42 } // namespace llvm
43 
44 #endif // LLVM_IR_PRINTPASSES_H
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
StringRef.h
llvm::shouldPrintBeforeAll
bool shouldPrintBeforeAll()
Definition: PrintPasses.cpp:61
llvm::shouldPrintAfterSomePass
bool shouldPrintAfterSomePass()
Definition: PrintPasses.cpp:52
llvm::shouldPrintBeforeSomePass
bool shouldPrintBeforeSomePass()
This is a helper to determine whether to print IR before or after a pass.
Definition: PrintPasses.cpp:48
llvm::shouldPrintAfterAll
bool shouldPrintAfterAll()
Definition: PrintPasses.cpp:63
llvm::isFunctionInPrintList
bool isFunctionInPrintList(StringRef FunctionName)
Definition: PrintPasses.cpp:83
llvm::printBeforePasses
std::vector< std::string > printBeforePasses()
Definition: PrintPasses.cpp:73
llvm::printAfterPasses
std::vector< std::string > printAfterPasses()
Definition: PrintPasses.cpp:77
llvm::shouldPrintAfterPass
bool shouldPrintAfterPass(StringRef PassID)
Definition: PrintPasses.cpp:69
llvm::shouldPrintBeforePass
bool shouldPrintBeforePass(StringRef PassID)
Definition: PrintPasses.cpp:65
llvm::forcePrintModuleIR
bool forcePrintModuleIR()
Definition: PrintPasses.cpp:81