don't check the result of printInstruction anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78444 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-08-08 00:05:42 +00:00
parent 941222eea0
commit 2698cb6811
6 changed files with 12 additions and 25 deletions

View File

@ -175,9 +175,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
II != E; ++II) {
// Print the assembly for the instruction.
++EmittedInsts;
if (!printInstruction(II)) {
llvm_unreachable("Unhandled instruction in asm writer!");
}
printInstruction(II);
}
}

View File

@ -142,10 +142,7 @@ void MSP430AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
++EmittedInsts;
// Call the autogenerated instruction printer routines.
if (printInstruction(MI))
return;
llvm_unreachable("Should not happen");
printInstruction(MI);
}
void MSP430AsmPrinter::printOperand(const MachineInstr *MI, int OpNum,

View File

@ -571,10 +571,7 @@ void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
}
}
if (printInstruction(MI))
return; // Printer was automatically generated
llvm_unreachable("Unhandled instruction in asm writer!");
printInstruction(MI);
}
/// runOnMachineFunction - This uses the printMachineInstruction()

View File

@ -152,10 +152,7 @@ void SystemZAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
++EmittedInsts;
// Call the autogenerated instruction printer routines.
if (printInstruction(MI))
return;
llvm_unreachable("Unreachable!");
printInstruction(MI);
}
void SystemZAsmPrinter::printPCRelImmOperand(const MachineInstr *MI, int OpNum) {

View File

@ -364,10 +364,7 @@ void XCoreAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
O << "\n";
return;
}
if (printInstruction(MI)) {
return;
}
llvm_unreachable("Unhandled instruction in asm writer!");
printInstruction(MI);
}
bool XCoreAsmPrinter::doInitialization(Module &M) {

View File

@ -113,13 +113,15 @@ namespace llvm {
std::string AsmWriterOperand::getCode() const {
if (OperandType == isLiteralTextOperand)
if (OperandType == isLiteralTextOperand) {
if (Str.size() == 1)
return "O << '" + Str + "'; ";
return "O << \"" + Str + "\"; ";
if (OperandType == isLiteralStatementOperand) {
return Str;
}
if (OperandType == isLiteralStatementOperand)
return Str;
std::string Result = Str + "(MI";
if (MIOpNo != ~0U)
Result += ", " + utostr(MIOpNo);
@ -448,9 +450,8 @@ FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands,
Command = " " + Inst->Operands[0].getCode() + "\n";
// If this is the last operand, emit a return.
if (Inst->Operands.size() == 1) {
if (Inst->Operands.size() == 1)
Command += " return true;\n";
}
// Check to see if we already have 'Command' in UniqueOperandCommands.
// If not, add it.