II != E; ++II) {
// Print the assembly for the instruction.
++EmittedInsts;
- if (!printInstruction(II)) {
- llvm_unreachable("Unhandled instruction in asm writer!");
- }
+ printInstruction(II);
}
}
++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,
}
}
- if (printInstruction(MI))
- return; // Printer was automatically generated
-
- llvm_unreachable("Unhandled instruction in asm writer!");
+ printInstruction(MI);
}
/// runOnMachineFunction - This uses the printMachineInstruction()
++EmittedInsts;
// Call the autogenerated instruction printer routines.
- if (printInstruction(MI))
- return;
-
- llvm_unreachable("Unreachable!");
+ printInstruction(MI);
}
void SystemZAsmPrinter::printPCRelImmOperand(const MachineInstr *MI, int OpNum) {
O << "\n";
return;
}
- if (printInstruction(MI)) {
- return;
- }
- llvm_unreachable("Unhandled instruction in asm writer!");
+ printInstruction(MI);
}
bool XCoreAsmPrinter::doInitialization(Module &M) {
std::string AsmWriterOperand::getCode() const {
- if (OperandType == isLiteralTextOperand)
+ if (OperandType == isLiteralTextOperand) {
+ if (Str.size() == 1)
+ return "O << '" + Str + "'; ";
return "O << \"" + Str + "\"; ";
+ }
- if (OperandType == isLiteralStatementOperand) {
+ if (OperandType == isLiteralStatementOperand)
return Str;
- }
std::string Result = Str + "(MI";
if (MIOpNo != ~0U)
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.