1353358Sdim//===- MIRPrinter.h - MIR serialization format printer ----------*- C++ -*-===//
2317948Sdim//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6317948Sdim//
7317948Sdim//===----------------------------------------------------------------------===//
8317948Sdim//
9317948Sdim// This file declares the functions that print out the LLVM IR and the machine
10317948Sdim// functions using the MIR serialization format.
11317948Sdim//
12317948Sdim//===----------------------------------------------------------------------===//
13317948Sdim
14317948Sdim#ifndef LLVM_LIB_CODEGEN_MIRPRINTER_H
15317948Sdim#define LLVM_LIB_CODEGEN_MIRPRINTER_H
16317948Sdim
17317948Sdimnamespace llvm {
18317948Sdim
19317948Sdimclass MachineBasicBlock;
20317948Sdimclass MachineFunction;
21317948Sdimclass Module;
22317948Sdimclass raw_ostream;
23317948Sdimtemplate <typename T> class SmallVectorImpl;
24317948Sdim
25317948Sdim/// Print LLVM IR using the MIR serialization format to the given output stream.
26317948Sdimvoid printMIR(raw_ostream &OS, const Module &M);
27317948Sdim
28317948Sdim/// Print a machine function using the MIR serialization format to the given
29317948Sdim/// output stream.
30317948Sdimvoid printMIR(raw_ostream &OS, const MachineFunction &MF);
31317948Sdim
32317948Sdim/// Determine a possible list of successors of a basic block based on the
33317948Sdim/// basic block machine operand being used inside the block. This should give
34317948Sdim/// you the correct list of successor blocks in most cases except for things
35317948Sdim/// like jump tables where the basic block references can't easily be found.
36317948Sdim/// The MIRPRinter will skip printing successors if they match the result of
37317948Sdim/// this funciton and the parser will use this function to construct a list if
38317948Sdim/// it is missing.
39317948Sdimvoid guessSuccessors(const MachineBasicBlock &MBB,
40341825Sdim                     SmallVectorImpl<MachineBasicBlock*> &Result,
41317948Sdim                     bool &IsFallthrough);
42317948Sdim
43317948Sdim} // end namespace llvm
44317948Sdim
45317948Sdim#endif
46