MIRPrinter.h 1.7 KB

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