xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64MCInstLower.h (revision 7a6dacaca14b62ca4b74406814becb87a3fefac0)
10b57cec5SDimitry Andric //===-- AArch64MCInstLower.h - Lower MachineInstr to MCInst ---------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64MCINSTLOWER_H
100b57cec5SDimitry Andric #define LLVM_LIB_TARGET_AARCH64_AARCH64MCINSTLOWER_H
110b57cec5SDimitry Andric 
12*7a6dacacSDimitry Andric #include "llvm/IR/GlobalValue.h"
130b57cec5SDimitry Andric #include "llvm/Support/Compiler.h"
1406c3fb27SDimitry Andric #include "llvm/TargetParser/Triple.h"
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric namespace llvm {
170b57cec5SDimitry Andric class AsmPrinter;
180b57cec5SDimitry Andric class MCContext;
190b57cec5SDimitry Andric class MCInst;
200b57cec5SDimitry Andric class MCOperand;
210b57cec5SDimitry Andric class MCSymbol;
220b57cec5SDimitry Andric class MachineInstr;
230b57cec5SDimitry Andric class MachineOperand;
240b57cec5SDimitry Andric 
250b57cec5SDimitry Andric /// AArch64MCInstLower - This class is used to lower an MachineInstr
260b57cec5SDimitry Andric /// into an MCInst.
270b57cec5SDimitry Andric class LLVM_LIBRARY_VISIBILITY AArch64MCInstLower {
280b57cec5SDimitry Andric   MCContext &Ctx;
290b57cec5SDimitry Andric   AsmPrinter &Printer;
300b57cec5SDimitry Andric   Triple TargetTriple;
310b57cec5SDimitry Andric 
320b57cec5SDimitry Andric public:
330b57cec5SDimitry Andric   AArch64MCInstLower(MCContext &ctx, AsmPrinter &printer);
340b57cec5SDimitry Andric 
350b57cec5SDimitry Andric   bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const;
360b57cec5SDimitry Andric   void Lower(const MachineInstr *MI, MCInst &OutMI) const;
370b57cec5SDimitry Andric 
385f757f3fSDimitry Andric   MCOperand lowerSymbolOperandMachO(const MachineOperand &MO,
390b57cec5SDimitry Andric                                     MCSymbol *Sym) const;
400b57cec5SDimitry Andric   MCOperand lowerSymbolOperandELF(const MachineOperand &MO,
410b57cec5SDimitry Andric                                   MCSymbol *Sym) const;
420b57cec5SDimitry Andric   MCOperand lowerSymbolOperandCOFF(const MachineOperand &MO,
430b57cec5SDimitry Andric                                    MCSymbol *Sym) const;
440b57cec5SDimitry Andric   MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
450b57cec5SDimitry Andric 
46*7a6dacacSDimitry Andric   MCSymbol *GetGlobalValueSymbol(const GlobalValue *GV,
47*7a6dacacSDimitry Andric                                  unsigned TargetFlags) const;
480b57cec5SDimitry Andric   MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
490b57cec5SDimitry Andric   MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
500b57cec5SDimitry Andric };
510b57cec5SDimitry Andric }
520b57cec5SDimitry Andric 
530b57cec5SDimitry Andric #endif
54