1//===- IRPrintingPasses.h - Passes to print out IR constructs ---*- C++ -*-===//
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/// \file
9///
10/// This file contains an interface for creating legacy passes to print out IR
11/// in various granularities.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_IR_IRPRINTINGPASSES_H
16#define LLVM_IR_IRPRINTINGPASSES_H
17
18#include <string>
19
20namespace llvm {
21class raw_ostream;
22class StringRef;
23class FunctionPass;
24class ModulePass;
25class Pass;
26
27/// Create and return a pass that writes the module to the specified
28/// \c raw_ostream.
29ModulePass *createPrintModulePass(raw_ostream &OS,
30 const std::string &Banner = "",
31 bool ShouldPreserveUseListOrder = false);
32
33/// Create and return a pass that prints functions to the specified
34/// \c raw_ostream as they are processed.
35FunctionPass *createPrintFunctionPass(raw_ostream &OS,
36 const std::string &Banner = "");
37
38/// Print out a name of an LLVM value without any prefixes.
39///
40/// The name is surrounded with ""'s and escaped if it has any special or
41/// non-printable characters in it.
42void printLLVMNameWithoutPrefix(raw_ostream &OS, StringRef Name);
43
44/// Return true if a pass is for IR printing.
45bool isIRPrintingPass(Pass *P);
46
47} // namespace llvm
48
49#endif
50

source code of llvm/include/llvm/IR/IRPrintingPasses.h