don't check the result of printInstruction anymore.
authorChris Lattner <sabre@nondot.org>
Sat, 8 Aug 2009 00:05:42 +0000 (00:05 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 8 Aug 2009 00:05:42 +0000 (00:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78444 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
lib/Target/MSP430/MSP430AsmPrinter.cpp
lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
lib/Target/XCore/XCoreAsmPrinter.cpp
utils/TableGen/AsmWriterEmitter.cpp

index c2152a42b31c9a6f4160c374c953876bc9fd3b65..92b85d304ca3b59381aeef381e0d9744832020e9 100644 (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);
     }
   }
 
index 2da7cdd61ca22aff471bdf2b535ad3937fa9e4e1..573ca57ec0e34a4374d89961e54e6f102a714e71 100644 (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,
index d7e050f64097afc4686c36d8bc148153c6f55755..8a0c767db58fdff264dc72813c05ea209b42fd67 100644 (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()
index b82396895f933b717f2d29ece1aa907184f0b677..2c73517db9bf45e44fcf689b5a82e732cdbb3997 100644 (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) {
index dc312129d2362e8d3bbbdea2dc94d164c5ff84c4..1b08c5f4c373f8d26f0bef6b94d63ff8756d240f 100644 (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) {
index db23febbfb0bc6b12bfdba498dfcb146303c79c9..95d4aac1300754dcfdefa07c23cb1a6693227a73 100644 (file)
@@ -113,12 +113,14 @@ 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) {
+  if (OperandType == isLiteralStatementOperand)
     return Str;
-  }
 
   std::string Result = Str + "(MI";
   if (MIOpNo != ~0U)
@@ -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.