LLVM 22.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 StringRef getPassName() const override { return "Xtensa Assembly Printer"; }
39 void emitInstruction(const MachineInstr *MI) override;
40
41 void emitConstantPool() override;
42
43 void emitMachineConstantPoolEntry(const MachineConstantPoolEntry &CPE, int i);
44
45 void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
46
47 void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
48
49 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
50 const char *ExtraCode, raw_ostream &O) override;
51
52 bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
53 const char *ExtraCode, raw_ostream &OS) override;
54
55 MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
56
57 MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
58
61 unsigned Offset) const;
62
63 // Lower MachineInstr MI to MCInst OutMI.
64 void lowerToMCInst(const MachineInstr *MI, MCInst &OutMI) const;
65
66 // Return an MCOperand for MO. Return an empty operand if MO is implicit.
67 MCOperand lowerOperand(const MachineOperand &MO, unsigned Offset = 0) const;
68};
69} // end namespace llvm
70
71#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:93
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:220
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
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
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:477
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:1869
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:851