BPFMCInstLower.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //===-- BPFMCInstLower.h - Lower MachineInstr to MCInst ---------*- 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. #ifndef LLVM_LIB_TARGET_BPF_BPFMCINSTLOWER_H
  9. #define LLVM_LIB_TARGET_BPF_BPFMCINSTLOWER_H
  10. #include "llvm/Support/Compiler.h"
  11. namespace llvm {
  12. class AsmPrinter;
  13. class MCContext;
  14. class MCInst;
  15. class MCOperand;
  16. class MCSymbol;
  17. class MachineInstr;
  18. class MachineOperand;
  19. // BPFMCInstLower - This class is used to lower an MachineInstr into an MCInst.
  20. class LLVM_LIBRARY_VISIBILITY BPFMCInstLower {
  21. MCContext &Ctx;
  22. AsmPrinter &Printer;
  23. public:
  24. BPFMCInstLower(MCContext &ctx, AsmPrinter &printer)
  25. : Ctx(ctx), Printer(printer) {}
  26. void Lower(const MachineInstr *MI, MCInst &OutMI) const;
  27. MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
  28. MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
  29. MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
  30. };
  31. }
  32. #endif