LLVM 24.0.0git
IRPrintingPasses.h
Go to the documentation of this file.
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
19#include <string>
20
21namespace llvm {
22class raw_ostream;
23class StringRef;
24class FunctionPass;
25class ModulePass;
26class Pass;
27
28/// Create and return a pass that writes the module to the specified
29/// \c raw_ostream.
31createPrintModulePass(raw_ostream &OS, const std::string &Banner = "",
32 bool ShouldPreserveUseListOrder = false);
33
35 const std::string &Banner,
36 bool ShouldPreserveUseListOrder,
37 bool ShouldRenumberMetadata);
38
39/// Create and return a pass that prints functions to the specified
40/// \c raw_ostream as they are processed.
42 const std::string &Banner = "");
43
44/// Print out a name of an LLVM value without any prefixes.
45///
46/// The name is surrounded with ""'s and escaped if it has any special or
47/// non-printable characters in it.
49
50/// Return true if a pass is for IR printing.
52
53} // namespace llvm
54
55#endif
#define LLVM_ABI
Definition Compiler.h:215
#define P(N)
FunctionPass class - This class is used to implement most global optimizations.
Definition Pass.h:314
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition Pass.h:255
Pass interface - Implemented by all 'passes'.
Definition Pass.h:99
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI bool isIRPrintingPass(Pass *P)
Return true if a pass is for IR printing.
LLVM_ABI ModulePass * createPrintModulePass(raw_ostream &OS, const std::string &Banner="", bool ShouldPreserveUseListOrder=false)
Create and return a pass that writes the module to the specified raw_ostream.
LLVM_ABI FunctionPass * createPrintFunctionPass(raw_ostream &OS, const std::string &Banner="")
Create and return a pass that prints functions to the specified raw_ostream as they are processed.
LLVM_ABI void printLLVMNameWithoutPrefix(raw_ostream &OS, StringRef Name)
Print out a name of an LLVM value without any prefixes.