LLVM 24.0.0git
XtensaAsmPrinter.h
Go to the documentation of this file.
1//===- XtensaAsmPrinter.h - Xtensa LLVM Assembly Printer --------*- 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// Xtensa Assembly printer class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_XTENSA_XTENSAASMPRINTER_H
14#define LLVM_LIB_TARGET_XTENSA_XTENSAASMPRINTER_H
15
16#include "XtensaTargetMachine.h"
20
21namespace llvm {
22class MCStreamer;
23class MachineInstr;
24class raw_ostream;
25
27 const MCSubtargetInfo *STI;
28
29public:
30 static char ID;
31
33 std::unique_ptr<MCStreamer> Streamer)
34 : AsmPrinter(TM, std::move(Streamer), ID), STI(&TM.getMCSubtargetInfo()) {
35 }
36
37 StringRef getPassName() const override { return "Xtensa Assembly Printer"; }
38 void emitInstruction(const MachineInstr *MI) override;
39
40 void emitConstantPool() override;
41
42 void emitMachineConstantPoolEntry(const MachineConstantPoolEntry &CPE, int i);
43
44 void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
45
46 void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
47
48 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
49 const char *ExtraCode, raw_ostream &O) override;
50
51 bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
52 const char *ExtraCode, raw_ostream &OS) override;
53
54 MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
55
56 MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
57
60 unsigned Offset) const;
61
62 // Lower MachineInstr MI to MCInst OutMI.
63 void lowerToMCInst(const MachineInstr *MI, MCInst &OutMI) const;
64
65 // Return an MCOperand for MO. Return an empty operand if MO is implicit.
66 MCOperand lowerOperand(const MachineOperand &MO, unsigned Offset = 0) const;
67};
68} // end namespace llvm
69
70#endif /* LLVM_LIB_TARGET_XTENSA_XTENSAASMPRINTER_H */
#define LLVM_LIBRARY_VISIBILITY
Definition Compiler.h:137
static void emitConstantPool(MCStreamer &Streamer, MCSection *Section, ConstantPool &CP)
IRTranslator LLVM IR MI
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
std::unique_ptr< MCStreamer > && Streamer
static MCOperand LowerSymbolOperand(const MachineInstr *MI, const MachineOperand &MO, const MCSymbol *Symbol, AsmPrinter &AP)
TargetMachine & TM
Target machine description.
Definition AsmPrinter.h:96
AsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer, char &ID=AsmPrinter::ID)
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:187
Instances of this class represent operands of the MCInst class.
Definition MCInst.h:39
Streaming machine code generation interface.
Definition MCStreamer.h:221
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
This class is a data container for one entry in a MachineConstantPool.
Abstract base class for all machine specific constantpool value subclasses.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
Primary interface to the complete machine description for the target machine.
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
XtensaAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:577
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1933
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:879