[PM] Simplify the interface exposed for IR printing passes.
[oota-llvm.git] / include / llvm / IR / IRPrintingPasses.h
1 //===- IRPrintingPasses.h - Passes to print out IR constructs ---*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 /// \file
10 ///
11 /// This file defines passes to print out IR in various granularities. The
12 /// PrintModulePass pass simply prints out the entire module when it is
13 /// executed. The PrintFunctionPass class is designed to be pipelined with
14 /// other FunctionPass's, and prints out the functions of the module as they
15 /// are processed.
16 ///
17 //===----------------------------------------------------------------------===//
18
19 #ifndef LLVM_IR_PRINTMODULEPASS_H
20 #define LLVM_IR_PRINTMODULEPASS_H
21
22 #include <string>
23
24 namespace llvm {
25 class FunctionPass;
26 class ModulePass;
27 class BasicBlockPass;
28 class raw_ostream;
29
30 /// \brief Create and return a pass that writes the module to the specified
31 /// \c raw_ostream.
32 ModulePass *createPrintModulePass(raw_ostream &OS,
33                                   const std::string &Banner = "");
34
35 /// \brief Create and return a pass that prints functions to the specified
36 /// \c raw_ostream as they are processed.
37 FunctionPass *createPrintFunctionPass(raw_ostream &OS,
38                                       const std::string &Banner = "");
39
40 /// \brief Create and return a pass that writes the BB to the specified
41 /// \c raw_ostream.
42 BasicBlockPass *createPrintBasicBlockPass(raw_ostream &OS,
43                                           const std::string &Banner = "");
44
45 /// \brief Pass for printing a Module as LLVM's text IR assembly.
46 ///
47 /// NOTE: This pass is for use with the new pass manager. Use the create...Pass
48 /// functions above to create passes for use with the legacy pass manager.
49 class AOEUPrintModulePass {
50 };
51
52 } // End llvm namespace
53
54 #endif