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