1 //===- MIRPrinter.h - MIR serialization format printer --------------------===// 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 // 10 // This file declares the functions that print out the LLVM IR and the machine 11 // functions using the MIR serialization format. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #ifndef LLVM_LIB_CODEGEN_MIRPRINTER_H 16 #define LLVM_LIB_CODEGEN_MIRPRINTER_H 17 18 namespace llvm { 19 20 class MachineBasicBlock; 21 class MachineFunction; 22 class Module; 23 class raw_ostream; 24 template <typename T> class SmallVectorImpl; 25 26 /// Print LLVM IR using the MIR serialization format to the given output stream. 27 void printMIR(raw_ostream &OS, const Module &M); 28 29 /// Print a machine function using the MIR serialization format to the given 30 /// output stream. 31 void printMIR(raw_ostream &OS, const MachineFunction &MF); 32 33 /// Determine a possible list of successors of a basic block based on the 34 /// basic block machine operand being used inside the block. This should give 35 /// you the correct list of successor blocks in most cases except for things 36 /// like jump tables where the basic block references can't easily be found. 37 /// The MIRPRinter will skip printing successors if they match the result of 38 /// this funciton and the parser will use this function to construct a list if 39 /// it is missing. 40 void guessSuccessors(const MachineBasicBlock &MBB, 41 SmallVectorImpl<MachineBasicBlock*> &Successors, 42 bool &IsFallthrough); 43 44 } // end namespace llvm 45 46 #endif 47