Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:07

0001 //===- IRPrintingPasses.h - Passes to print out IR constructs ---*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 /// \file
0009 ///
0010 /// This file contains an interface for creating legacy passes to print out IR
0011 /// in various granularities.
0012 ///
0013 //===----------------------------------------------------------------------===//
0014 
0015 #ifndef LLVM_IR_IRPRINTINGPASSES_H
0016 #define LLVM_IR_IRPRINTINGPASSES_H
0017 
0018 #include <string>
0019 
0020 namespace llvm {
0021 class raw_ostream;
0022 class StringRef;
0023 class FunctionPass;
0024 class ModulePass;
0025 class Pass;
0026 
0027 /// Create and return a pass that writes the module to the specified
0028 /// \c raw_ostream.
0029 ModulePass *createPrintModulePass(raw_ostream &OS,
0030                                   const std::string &Banner = "",
0031                                   bool ShouldPreserveUseListOrder = false);
0032 
0033 /// Create and return a pass that prints functions to the specified
0034 /// \c raw_ostream as they are processed.
0035 FunctionPass *createPrintFunctionPass(raw_ostream &OS,
0036                                       const std::string &Banner = "");
0037 
0038 /// Print out a name of an LLVM value without any prefixes.
0039 ///
0040 /// The name is surrounded with ""'s and escaped if it has any special or
0041 /// non-printable characters in it.
0042 void printLLVMNameWithoutPrefix(raw_ostream &OS, StringRef Name);
0043 
0044 /// Return true if a pass is for IR printing.
0045 bool isIRPrintingPass(Pass *P);
0046 
0047 } // namespace llvm
0048 
0049 #endif