MIParser.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //===- MIParser.h - Machine Instructions Parser ---------------------------===//
  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 function that parses the machine instructions.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_LIB_CODEGEN_MIRPARSER_MIPARSER_H
  14. #define LLVM_LIB_CODEGEN_MIRPARSER_MIPARSER_H
  15. #include "llvm/ADT/DenseMap.h"
  16. #include "llvm/ADT/StringRef.h"
  17. namespace llvm {
  18. class MachineBasicBlock;
  19. class MachineInstr;
  20. class MachineFunction;
  21. struct SlotMapping;
  22. class SMDiagnostic;
  23. class SourceMgr;
  24. struct PerFunctionMIParsingState {
  25. DenseMap<unsigned, MachineBasicBlock *> MBBSlots;
  26. DenseMap<unsigned, unsigned> VirtualRegisterSlots;
  27. };
  28. bool parseMachineInstr(MachineInstr *&MI, SourceMgr &SM, MachineFunction &MF,
  29. StringRef Src, const PerFunctionMIParsingState &PFS,
  30. const SlotMapping &IRSlots, SMDiagnostic &Error);
  31. bool parseMBBReference(MachineBasicBlock *&MBB, SourceMgr &SM,
  32. MachineFunction &MF, StringRef Src,
  33. const PerFunctionMIParsingState &PFS,
  34. const SlotMapping &IRSlots, SMDiagnostic &Error);
  35. bool parseNamedRegisterReference(unsigned &Reg, SourceMgr &SM,
  36. MachineFunction &MF, StringRef Src,
  37. const PerFunctionMIParsingState &PFS,
  38. const SlotMapping &IRSlots,
  39. SMDiagnostic &Error);
  40. } // end namespace llvm
  41. #endif