mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Remove leftovers from a non-MC asm printer.
llvm-svn: 196068
This commit is contained in:
parent
b121e6ba41
commit
29768368be
@ -61,17 +61,6 @@ static cl::opt<bool> AlignCalls(
|
||||
"hexagon-align-calls", cl::Hidden, cl::init(true),
|
||||
cl::desc("Insert falign after call instruction for Hexagon target"));
|
||||
|
||||
void HexagonAsmPrinter::EmitAlignment(unsigned NumBits,
|
||||
const GlobalValue *GV) const {
|
||||
// For basic block level alignment, use ".falign".
|
||||
if (!GV) {
|
||||
OutStreamer.EmitRawText(StringRef("\t.falign"));
|
||||
return;
|
||||
}
|
||||
|
||||
AsmPrinter::EmitAlignment(NumBits, GV);
|
||||
}
|
||||
|
||||
void HexagonAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
raw_ostream &O) {
|
||||
const MachineOperand &MO = MI->getOperand(OpNo);
|
||||
@ -186,12 +175,6 @@ bool HexagonAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
||||
return false;
|
||||
}
|
||||
|
||||
void HexagonAsmPrinter::printPredicateOperand(const MachineInstr *MI,
|
||||
unsigned OpNo,
|
||||
raw_ostream &O) {
|
||||
llvm_unreachable("Unimplemented");
|
||||
}
|
||||
|
||||
|
||||
/// printMachineInstruction -- Print out a single Hexagon MI in Darwin syntax to
|
||||
/// the current output stream.
|
||||
@ -240,60 +223,6 @@ void HexagonAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
return;
|
||||
}
|
||||
|
||||
/// PrintUnmangledNameSafely - Print out the printable characters in the name.
|
||||
/// Don't print things like \n or \0.
|
||||
// static void PrintUnmangledNameSafely(const Value *V, raw_ostream &OS) {
|
||||
// for (const char *Name = V->getNameStart(), *E = Name+V->getNameLen();
|
||||
// Name != E; ++Name)
|
||||
// if (isprint(*Name))
|
||||
// OS << *Name;
|
||||
// }
|
||||
|
||||
|
||||
void HexagonAsmPrinter::printAddrModeBasePlusOffset(const MachineInstr *MI,
|
||||
int OpNo, raw_ostream &O) {
|
||||
const MachineOperand &MO1 = MI->getOperand(OpNo);
|
||||
const MachineOperand &MO2 = MI->getOperand(OpNo+1);
|
||||
|
||||
O << HexagonInstPrinter::getRegisterName(MO1.getReg())
|
||||
<< " + #"
|
||||
<< MO2.getImm();
|
||||
}
|
||||
|
||||
|
||||
void HexagonAsmPrinter::printGlobalOperand(const MachineInstr *MI, int OpNo,
|
||||
raw_ostream &O) {
|
||||
const MachineOperand &MO = MI->getOperand(OpNo);
|
||||
assert( (MO.getType() == MachineOperand::MO_GlobalAddress) &&
|
||||
"Expecting global address");
|
||||
|
||||
O << *getSymbol(MO.getGlobal());
|
||||
if (MO.getOffset() != 0) {
|
||||
O << " + ";
|
||||
O << MO.getOffset();
|
||||
}
|
||||
}
|
||||
|
||||
void HexagonAsmPrinter::printJumpTable(const MachineInstr *MI, int OpNo,
|
||||
raw_ostream &O) {
|
||||
const MachineOperand &MO = MI->getOperand(OpNo);
|
||||
assert( (MO.getType() == MachineOperand::MO_JumpTableIndex) &&
|
||||
"Expecting jump table index");
|
||||
|
||||
// Hexagon_TODO: Do we need name mangling?
|
||||
O << *GetJTISymbol(MO.getIndex());
|
||||
}
|
||||
|
||||
void HexagonAsmPrinter::printConstantPool(const MachineInstr *MI, int OpNo,
|
||||
raw_ostream &O) {
|
||||
const MachineOperand &MO = MI->getOperand(OpNo);
|
||||
assert( (MO.getType() == MachineOperand::MO_ConstantPoolIndex) &&
|
||||
"Expecting constant pool index");
|
||||
|
||||
// Hexagon_TODO: Do we need name mangling?
|
||||
O << *GetCPISymbol(MO.getIndex());
|
||||
}
|
||||
|
||||
static MCInstPrinter *createHexagonMCInstPrinter(const Target &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI,
|
||||
|
@ -37,8 +37,6 @@ namespace llvm {
|
||||
bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const;
|
||||
|
||||
virtual void EmitInstruction(const MachineInstr *MI);
|
||||
virtual void EmitAlignment(unsigned NumBits,
|
||||
const GlobalValue *GV = 0) const;
|
||||
|
||||
void printOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O);
|
||||
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
@ -48,101 +46,6 @@ namespace llvm {
|
||||
unsigned AsmVariant, const char *ExtraCode,
|
||||
raw_ostream &OS);
|
||||
|
||||
// void printMachineInstruction(const MachineInstr *MI);
|
||||
void printOp(const MachineOperand &MO, raw_ostream &O);
|
||||
|
||||
/// printRegister - Print register according to target requirements.
|
||||
///
|
||||
void printRegister(const MachineOperand &MO, bool R0AsZero,
|
||||
raw_ostream &O) {
|
||||
unsigned RegNo = MO.getReg();
|
||||
assert(TargetRegisterInfo::isPhysicalRegister(RegNo) && "Not physreg??");
|
||||
O << getRegisterName(RegNo);
|
||||
}
|
||||
|
||||
void printImmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
raw_ostream &O) {
|
||||
int value = MI->getOperand(OpNo).getImm();
|
||||
O << value;
|
||||
}
|
||||
|
||||
void printNegImmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
raw_ostream &O) {
|
||||
int value = MI->getOperand(OpNo).getImm();
|
||||
O << -value;
|
||||
}
|
||||
|
||||
void printMEMriOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
raw_ostream &O) {
|
||||
const MachineOperand &MO1 = MI->getOperand(OpNo);
|
||||
const MachineOperand &MO2 = MI->getOperand(OpNo+1);
|
||||
|
||||
O << getRegisterName(MO1.getReg())
|
||||
<< " + #"
|
||||
<< (int) MO2.getImm();
|
||||
}
|
||||
|
||||
void printFrameIndexOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
raw_ostream &O) {
|
||||
const MachineOperand &MO1 = MI->getOperand(OpNo);
|
||||
const MachineOperand &MO2 = MI->getOperand(OpNo+1);
|
||||
|
||||
O << getRegisterName(MO1.getReg())
|
||||
<< ", #"
|
||||
<< MO2.getImm();
|
||||
}
|
||||
|
||||
void printBranchOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
raw_ostream &O) {
|
||||
// Branches can take an immediate operand. This is used by the branch
|
||||
// selection pass to print $+8, an eight byte displacement from the PC.
|
||||
if (MI->getOperand(OpNo).isImm()) {
|
||||
O << "$+" << MI->getOperand(OpNo).getImm()*4;
|
||||
} else {
|
||||
printOp(MI->getOperand(OpNo), O);
|
||||
}
|
||||
}
|
||||
|
||||
void printCallOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
raw_ostream &O) {
|
||||
}
|
||||
|
||||
void printAbsAddrOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
raw_ostream &O) {
|
||||
}
|
||||
|
||||
void printSymbolHi(const MachineInstr *MI, unsigned OpNo, raw_ostream &O) {
|
||||
O << "#HI(";
|
||||
if (MI->getOperand(OpNo).isImm()) {
|
||||
printImmOperand(MI, OpNo, O);
|
||||
}
|
||||
else {
|
||||
printOp(MI->getOperand(OpNo), O);
|
||||
}
|
||||
O << ")";
|
||||
}
|
||||
|
||||
void printSymbolLo(const MachineInstr *MI, unsigned OpNo, raw_ostream &O) {
|
||||
O << "#HI(";
|
||||
if (MI->getOperand(OpNo).isImm()) {
|
||||
printImmOperand(MI, OpNo, O);
|
||||
}
|
||||
else {
|
||||
printOp(MI->getOperand(OpNo), O);
|
||||
}
|
||||
O << ")";
|
||||
}
|
||||
|
||||
void printPredicateOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
raw_ostream &O);
|
||||
|
||||
void printAddrModeBasePlusOffset(const MachineInstr *MI, int OpNo,
|
||||
raw_ostream &O);
|
||||
|
||||
void printGlobalOperand(const MachineInstr *MI, int OpNo, raw_ostream &O);
|
||||
void printJumpTable(const MachineInstr *MI, int OpNo, raw_ostream &O);
|
||||
void printConstantPool(const MachineInstr *MI, int OpNo, raw_ostream &O);
|
||||
|
||||
static const char *getRegisterName(unsigned RegNo);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user