LLVM 19.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 defines passes to print out IR in various granularities. The
11/// PrintModulePass pass simply prints out the entire module when it is
12/// executed. The PrintFunctionPass class is designed to be pipelined with
13/// other FunctionPass's, and prints out the functions of the module as they
14/// are processed.
15///
16//===----------------------------------------------------------------------===//
17
18#ifndef LLVM_IRPRINTER_IRPRINTINGPASSES_H
19#define LLVM_IRPRINTER_IRPRINTINGPASSES_H
20
21#include "llvm/IR/PassManager.h"
22#include <string>
23
24namespace llvm {
25class raw_ostream;
26class Function;
27class Module;
28class Pass;
29
30/// Pass (for the new pass manager) for printing a Module as
31/// LLVM's text IR assembly.
32class PrintModulePass : public PassInfoMixin<PrintModulePass> {
33 raw_ostream &OS;
34 std::string Banner;
35 bool ShouldPreserveUseListOrder;
36 bool EmitSummaryIndex;
37
38public:
40 PrintModulePass(raw_ostream &OS, const std::string &Banner = "",
41 bool ShouldPreserveUseListOrder = false,
42 bool EmitSummaryIndex = false);
43
45 static bool isRequired() { return true; }
46};
47
48/// Pass (for the new pass manager) for printing a Function as
49/// LLVM's text IR assembly.
50class PrintFunctionPass : public PassInfoMixin<PrintFunctionPass> {
51 raw_ostream &OS;
52 std::string Banner;
53
54public:
56 PrintFunctionPass(raw_ostream &OS, const std::string &Banner = "");
57
59 static bool isRequired() { return true; }
60};
61
62} // namespace llvm
63
64#endif
aarch64 AArch64 CCMP Pass
#define F(x, y, z)
Definition: MD5.cpp:55
Machine Check Debug Module
This header defines various interfaces for pass management in LLVM.
raw_pwrite_stream & OS
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:348
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:109
Pass (for the new pass manager) for printing a Function as LLVM's text IR assembly.
PreservedAnalyses run(Function &F, AnalysisManager< Function > &)
Pass (for the new pass manager) for printing a Module as LLVM's text IR assembly.
PreservedAnalyses run(Module &M, AnalysisManager< Module > &)
static bool isRequired()
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:91