LLVM 23.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;
24class MachineInstr;
25class Module;
26class raw_ostream;
27
29 const MCSubtargetInfo *STI;
30
31public:
32 static char ID;
33
35 std::unique_ptr<MCStreamer> Streamer)
36 : AsmPrinter(TM, std::move(Streamer), ID), STI(&TM.getMCSubtargetInfo()) {
37 }
38
39 StringRef getPassName() const override { return "Xtensa Assembly Printer"; }
40 void emitInstruction(const MachineInstr *MI) override;
41
42 void emitConstantPool() override;
43
44 void emitMachineConstantPoolEntry(const MachineConstantPoolEntry &CPE, int i);
45
46 void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
47
48 void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
49
50 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
51 const char *ExtraCode, raw_ostream &O) override;
52
53 bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
54 const char *ExtraCode, raw_ostream &OS) override;
55
56 MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
57
58 MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
59
62 unsigned Offset) const;
63
64 // Lower MachineInstr MI to MCInst OutMI.
65 void lowerToMCInst(const MachineInstr *MI, MCInst &OutMI) const;
66
67 // Return an MCOperand for MO. Return an empty operand if MO is implicit.
68 MCOperand lowerOperand(const MachineOperand &MO, unsigned Offset = 0) const;
69};
70} // end namespace llvm
71
72#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)
static MCOperand LowerSymbolOperand(const MachineInstr *MI, const MachineOperand &MO, const MCSymbol *Symbol, AsmPrinter &AP)
TargetMachine & TM
Target machine description.
Definition AsmPrinter.h:94
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:188
Instances of this class represent operands of the MCInst class.
Definition MCInst.h:40
Streaming machine code generation interface.
Definition MCStreamer.h:222
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.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
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:557
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:1916
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:874