47 unsigned Opc =
MI->getOpcode();
70 cast<XtensaConstantPoolConstant>(ACPV)->getBlockAddress();
76 unsigned Idx = cast<XtensaConstantPoolJumpTable>(ACPV)->getIndex();
81 const char *SymName = XtensaSym->
getSymbol();
98 std::string SymName(MCSym->
getName());
105 TS->emitLiteral(LblSym, Expr,
false);
122 Type *Ty =
C->getType();
123 if (
const auto *CFP = dyn_cast<ConstantFP>(
C)) {
125 CFP->getValueAPF().bitcastToAPInt().getSExtValue(),
OutContext);
126 }
else if (
const auto *CI = dyn_cast<ConstantInt>(
C)) {
128 }
else if (isa<PointerType>(Ty)) {
134 TS->emitLiteral(LblSym,
Value,
false);
145 const std::vector<MachineConstantPoolEntry> &CP = MCP->
getConstants();
154 TS->startLiteralSection(CS);
183 if (!ExtraCode || !ExtraCode[0]) {
194 const char *ExtraCode,
196 if (ExtraCode && ExtraCode[0])
199 assert(OpNo + 1 <
MI->getNumOperands() &&
"Insufficient operands");
205 "Unexpected base pointer for inline asm memory operand.");
206 assert(
Offset.isImm() &&
"Unexpected offset for inline asm memory operand.");
307 for (
unsigned i = 0, e =
MI->getNumOperands(); i != e; ++i) {
static MCSymbolRefExpr::VariantKind getModifierVariantKind(ARMCP::ARMCPModifier Modifier)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_EXTERNAL_VISIBILITY
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeXtensaAsmPrinter()
static MCSymbolRefExpr::VariantKind getModifierVariantKind(XtensaCP::XtensaCPModifier Modifier)
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
MCSymbol * getSymbol(const GlobalValue *GV) const
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
TargetMachine & TM
Target machine description.
virtual MCSymbol * GetCPISymbol(unsigned CPID) const
Return the symbol for the specified constant pool entry.
MachineFunction * MF
The current machine function.
MCSymbol * GetJTISymbol(unsigned JTID, bool isLinkerPrivate=false) const
Return the symbol for the specified jump table entry.
MCContext & OutContext
This is the context for the output file that we are streaming.
MCSymbol * GetExternalSymbolSymbol(Twine Sym) const
Return the MCSymbol for the specified ExternalSymbol.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
virtual const MCExpr * lowerConstant(const Constant *CV)
Lower the specified LLVM Constant to an MCExpr.
MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const
Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.
const DataLayout & getDataLayout() const
Return information about data layout.
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
The address of a basic block.
This is an important base class in LLVM.
A parsed version of the target data layout string in and methods for querying it.
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Base class for the full range of assembler expressions which are needed for parsing.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
Instances of this class represent operands of the MCInst class.
static MCOperand createExpr(const MCExpr *Val)
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
Instances of this class represent a uniqued identifier for a section in the current translation unit.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StringRef getName() const
getName - Get the symbol name.
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
This class is a data container for one entry in a MachineConstantPool.
bool isMachineConstantPoolEntry() const
isMachineConstantPoolEntry - Return true if the MachineConstantPoolEntry is indeed a target specific ...
union llvm::MachineConstantPoolEntry::@204 Val
The constant itself.
MachineConstantPoolValue * MachineCPVal
const Constant * ConstVal
Abstract base class for all machine specific constantpool value subclasses.
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
const std::vector< MachineConstantPoolEntry > & getConstants() const
Function & getFunction()
Return the LLVM function that this machine code represents.
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
const GlobalValue * getGlobal() const
MachineBasicBlock * getMBB() const
const BlockAddress * getBlockAddress() const
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
const char * getSymbolName() const
Register getReg() const
getReg - Returns the register number.
@ MO_Immediate
Immediate operand.
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
@ MO_GlobalAddress
Address of a global value.
@ MO_RegisterMask
Mask of preserved registers.
@ MO_BlockAddress
Address of a basic block.
@ MO_MachineBasicBlock
MachineBasicBlock reference.
@ MO_Register
Register operand.
@ MO_ExternalSymbol
Name of external global symbol.
@ MO_JumpTableIndex
Address of indexed Jump Table for switch.
int64_t getOffset() const
Return the offset from the symbol in this operand.
StringRef - Represent a constant reference to a string, i.e.
MCSection * SectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const
This method computes the appropriate section to emit the specified global variable or function defini...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &O) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
MCOperand LowerSymbolOperand(const MachineOperand &MO, MachineOperand::MachineOperandType MOTy, unsigned Offset) const
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
void emitMachineConstantPoolEntry(const MachineConstantPoolEntry &CPE, int i)
void emitConstantPool() override
Print to the current output stream assembly representations of the constants in the constant pool MCP...
void lowerToMCInst(const MachineInstr *MI, MCInst &OutMI) const
void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O)
MCSymbol * GetConstantPoolIndexSymbol(const MachineOperand &MO) const
void emitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
MCSymbol * GetJumpTableSymbol(const MachineOperand &MO) const
void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override
MCOperand lowerOperand(const MachineOperand &MO, unsigned Offset=0) const
XtensaConstantPoolSymbol - Xtensa-specific constantpool values for external symbols.
const char * getSymbol() const
XtensaConstantPoolValue - Xtensa specific constantpool value.
unsigned getLabelId() const
StringRef getModifierText() const
bool isMachineBasicBlock() const
bool isBlockAddress() const
void setLabelId(unsigned ID)
XtensaCP::XtensaCPModifier getModifier() const
static const char * getRegisterName(MCRegister Reg)
static void printOperand(const MCOperand &MO, raw_ostream &O)
static const XtensaMCExpr * create(const MCExpr *Expr, VariantKind Kind, MCContext &Ctx)
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Target & getTheXtensaTarget()
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...