AArch64MCInstLower.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //===-- AArch64MCInstLower.h - Lower MachineInstr to MCInst ---------------===//
  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. #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64MCINSTLOWER_H
  9. #define LLVM_LIB_TARGET_AARCH64_AARCH64MCINSTLOWER_H
  10. #include "llvm/ADT/Triple.h"
  11. #include "llvm/Support/Compiler.h"
  12. namespace llvm {
  13. class AsmPrinter;
  14. class MCContext;
  15. class MCInst;
  16. class MCOperand;
  17. class MCSymbol;
  18. class MachineInstr;
  19. class MachineOperand;
  20. /// AArch64MCInstLower - This class is used to lower an MachineInstr
  21. /// into an MCInst.
  22. class LLVM_LIBRARY_VISIBILITY AArch64MCInstLower {
  23. MCContext &Ctx;
  24. AsmPrinter &Printer;
  25. Triple TargetTriple;
  26. public:
  27. AArch64MCInstLower(MCContext &ctx, AsmPrinter &printer);
  28. bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const;
  29. void Lower(const MachineInstr *MI, MCInst &OutMI) const;
  30. MCOperand lowerSymbolOperandDarwin(const MachineOperand &MO,
  31. MCSymbol *Sym) const;
  32. MCOperand lowerSymbolOperandELF(const MachineOperand &MO,
  33. MCSymbol *Sym) const;
  34. MCOperand lowerSymbolOperandCOFF(const MachineOperand &MO,
  35. MCSymbol *Sym) const;
  36. MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
  37. MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
  38. MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
  39. };
  40. }
  41. #endif