16 #define DEBUG_TYPE "asm-printer"
62 cl::desc(
"Insert falign after call instruction for Hexagon target"));
129 const char *ExtraCode,
132 if (ExtraCode && ExtraCode[0]) {
133 if (ExtraCode[1] != 0)
return true;
135 switch (ExtraCode[0]) {
165 unsigned OpNo,
unsigned AsmVariant,
166 const char *ExtraCode,
168 if (ExtraCode && ExtraCode[0])
179 if (Offset.
isImm()) {
181 O <<
" + #" << Offset.
getImm();
201 std::vector<const MachineInstr*> BundleMIs;
206 unsigned int IgnoreCount = 0;
207 while (MII != MBB->
end() && MII->isInsideBundle()) {
216 BundleMIs.push_back(MInst);
219 unsigned Size = BundleMIs.size();
220 assert((Size+IgnoreCount) == MI->
getBundleSize() &&
"Corrupt Bundle!");
221 for (
unsigned Index = 0; Index < Size; Index++) {
232 if (MI->
getOpcode() == Hexagon::ENDLOOP0) {
268 "Expecting global address");
281 "Expecting jump table index");
291 "Expecting constant pool index");
298 unsigned SyntaxVariant,
303 if (SyntaxVariant == 0)
const GlobalValue * getGlobal() const
bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const
virtual void EmitAlignment(unsigned NumBits, const GlobalValue *GV=0) const
void EmitRawText(const Twine &String)
MCSymbol * getSymbol(const GlobalValue *GV) const
MachineBasicBlock * getMBB() const
static cl::opt< bool > AlignCalls("hexagon-align-calls", cl::Hidden, cl::init(true), cl::desc("Insert falign after call instruction for Hexagon target"))
void HexagonLowerToMC(const MachineInstr *MI, HexagonMCInst &MCI, HexagonAsmPrinter &AP)
virtual void EmitInstruction(const MCInst &Inst)=0
const char * getSymbolName() const
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
void printGlobalOperand(const MachineInstr *MI, int OpNo, raw_ostream &O)
Address of indexed Jump Table for switch.
unsigned getBundleSize() const
void setPacketEnd(bool Y)
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
#define llvm_unreachable(msg)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
MCSymbol * GetJTISymbol(unsigned JTID, bool isLinkerPrivate=false) const
GetJTISymbol - Return the symbol for the specified jump table entry.
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS)
unsigned getNumOperands() const
void printJumpTable(const MachineInstr *MI, int OpNo, raw_ostream &O)
Address of indexed Constant in Constant Pool.
static const char * getRegisterName(unsigned RegNo)
const MachineBasicBlock * getParent() const
void setPacketStart(bool Y)
initializer< Ty > init(const Ty &Val)
void printPredicateOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O)
const MachineOperand & getOperand(unsigned i) const
static MCInstPrinter * createHexagonMCInstPrinter(const Target &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI, const MCSubtargetInfo &STI)
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS)
void printConstantPool(const MachineInstr *MI, int OpNo, raw_ostream &O)
void printOffset(int64_t Offset, raw_ostream &OS) const
printOffset - This is just convenient handler for printing offsets.
int64_t getOffset() const
virtual bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const
MCSymbol * getSymbol() const
void LLVMInitializeHexagonAsmPrinter()
void printOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O)
MachineOperandType getType() const
bool hasAddressTaken() const
virtual void EmitInstruction(const MachineInstr *MI)
IMPLICIT_DEF - This is the MachineInstr-level equivalent of undef.
DBG_VALUE - a mapping of the llvm.dbg.value intrinsic.
void EmitAlignment(unsigned NumBits, const GlobalValue *GV=0) const
MCSymbol * GetCPISymbol(unsigned CPID) const
GetCPISymbol - Return the symbol for the specified constant pool entry.
unsigned getReg() const
getReg - Returns the register number.
const MCRegisterInfo & MRI
void printAddrModeBasePlusOffset(const MachineInstr *MI, int OpNo, raw_ostream &O)
MCSymbol * GetExternalSymbolSymbol(StringRef Sym) const
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")
MachineBasicBlock reference.
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS)
Address of a global value.
Name of external global symbol.