MIRPrinter.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- MIRPrinter.h - MIR serialization format printer ----------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file declares the functions that print out the LLVM IR and the machine
  15. // functions using the MIR serialization format.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_CODEGEN_MIRPRINTER_H
  19. #define LLVM_CODEGEN_MIRPRINTER_H
  20. namespace llvm {
  21. class MachineBasicBlock;
  22. class MachineFunction;
  23. class Module;
  24. class raw_ostream;
  25. template <typename T> class SmallVectorImpl;
  26. /// Print LLVM IR using the MIR serialization format to the given output stream.
  27. void printMIR(raw_ostream &OS, const Module &M);
  28. /// Print a machine function using the MIR serialization format to the given
  29. /// output stream.
  30. void printMIR(raw_ostream &OS, const MachineFunction &MF);
  31. /// Determine a possible list of successors of a basic block based on the
  32. /// basic block machine operand being used inside the block. This should give
  33. /// you the correct list of successor blocks in most cases except for things
  34. /// like jump tables where the basic block references can't easily be found.
  35. /// The MIRPRinter will skip printing successors if they match the result of
  36. /// this funciton and the parser will use this function to construct a list if
  37. /// it is missing.
  38. void guessSuccessors(const MachineBasicBlock &MBB,
  39. SmallVectorImpl<MachineBasicBlock*> &Result,
  40. bool &IsFallthrough);
  41. } // end namespace llvm
  42. #endif
  43. #ifdef __GNUC__
  44. #pragma GCC diagnostic pop
  45. #endif