[Codegen] Alter the default promotion for saturating adds and subs
[llvm-complete.git] / lib / Target / WebAssembly / WebAssemblyMCInstLower.h
blob2c375a01a7f5492a562b3a2898356ad8b86e9c55
1 //===-- WebAssemblyMCInstLower.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 ///
9 /// \file
10 /// This file declares the class to lower WebAssembly MachineInstrs to
11 /// their corresponding MCInst records.
12 ///
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMCINSTLOWER_H
16 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMCINSTLOWER_H
18 #include "llvm/MC/MCInst.h"
19 #include "llvm/Support/Compiler.h"
21 namespace llvm {
22 class WebAssemblyAsmPrinter;
23 class MCContext;
24 class MCSymbol;
25 class MachineInstr;
26 class MachineOperand;
28 /// This class is used to lower an MachineInstr into an MCInst.
29 class LLVM_LIBRARY_VISIBILITY WebAssemblyMCInstLower {
30 MCContext &Ctx;
31 WebAssemblyAsmPrinter &Printer;
33 MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
34 MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
35 MCOperand lowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
37 public:
38 WebAssemblyMCInstLower(MCContext &ctx, WebAssemblyAsmPrinter &printer)
39 : Ctx(ctx), Printer(printer) {}
40 void lower(const MachineInstr *MI, MCInst &OutMI) const;
42 } // end namespace llvm
44 #endif