LLVM 20.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 MachineBasicBlock;
24class MachineInstr;
25class Module;
26class raw_ostream;
27
29 const MCSubtargetInfo *STI;
30
31public:
33 std::unique_ptr<MCStreamer> Streamer)
34 : AsmPrinter(TM, std::move(Streamer)), STI(TM.getMCSubtargetInfo()) {}
35
36 StringRef getPassName() const override { return "Xtensa Assembly Printer"; }
37 void emitInstruction(const MachineInstr *MI) override;
38
39 void emitConstantPool() override;
40
41 void emitMachineConstantPoolEntry(const MachineConstantPoolEntry &CPE, int i);
42
43 void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
44
45 MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
46
47 MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
48
51 unsigned Offset) const;
52
53 // Lower MachineInstr MI to MCInst OutMI.
54 void lowerToMCInst(const MachineInstr *MI, MCInst &OutMI) const;
55
56 // Return an MCOperand for MO. Return an empty operand if MO is implicit.
57 MCOperand lowerOperand(const MachineOperand &MO, unsigned Offset = 0) const;
58};
59} // end namespace llvm
60
61#endif /* LLVM_LIB_TARGET_XTENSA_XTENSAASMPRINTER_H */
#define LLVM_LIBRARY_VISIBILITY
Definition: Compiler.h:131
static void emitConstantPool(MCStreamer &Streamer, MCSection *Section, ConstantPool &CP)
uint64_t Offset
Definition: ELF_riscv.cpp:478
IRTranslator LLVM IR MI
Machine Check Debug Module
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
const char LLVMTargetMachineRef TM
static MCOperand LowerSymbolOperand(const MachineInstr *MI, const MachineOperand &MO, AsmPrinter &AP)
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:86
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
Instances of this class represent operands of the MCInst class.
Definition: MCInst.h:36
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:41
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.
Definition: MachineInstr.h:69
MachineOperand class - Representation of each machine instruction operand.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
XtensaAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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:1849
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858