diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index c817ee932b0..2d9aa0f9d29 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -170,7 +170,7 @@ namespace { const char *ExtraCode); void PrintGlobalVariable(const GlobalVariable* GVar); - bool printInstruction(const MachineInstr *MI); // autogenerated. + void printInstruction(const MachineInstr *MI); // autogenerated. void printMachineInstruction(const MachineInstr *MI); bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); diff --git a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp index 92b85d304ca..a4690a9adef 100644 --- a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp +++ b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp @@ -46,7 +46,7 @@ namespace { virtual const char *getPassName() const { return "Alpha Assembly Printer"; } - bool printInstruction(const MachineInstr *MI); + void printInstruction(const MachineInstr *MI); void printOp(const MachineOperand &MO, bool IsCallOp = false); void printOperand(const MachineInstr *MI, int opNum); void printBaseOffsetPair(const MachineInstr *MI, int i, bool brackets=true); diff --git a/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp b/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp index b507968b872..e8e79a40241 100644 --- a/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp +++ b/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp @@ -48,7 +48,7 @@ namespace { void printOperand(const MachineInstr *MI, int opNum); void printMemoryOperand(const MachineInstr *MI, int opNum); - bool printInstruction(const MachineInstr *MI); // autogenerated. + void printInstruction(const MachineInstr *MI); // autogenerated. void emitLinkage(const std::string &n, GlobalValue::LinkageTypes l); bool runOnMachineFunction(MachineFunction &F); bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp index 3fbba3d8f0f..0fd485abefa 100644 --- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp +++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp @@ -67,7 +67,7 @@ namespace { /// from the instruction set description. This method returns true if the /// machine instruction was sufficiently described to print it, otherwise it /// returns false. - bool printInstruction(const MachineInstr *MI); + void printInstruction(const MachineInstr *MI); void printMachineInstruction(const MachineInstr *MI); void printOp(const MachineOperand &MO); diff --git a/lib/Target/MSP430/MSP430AsmPrinter.cpp b/lib/Target/MSP430/MSP430AsmPrinter.cpp index 573ca57ec0e..6209fc4c0a1 100644 --- a/lib/Target/MSP430/MSP430AsmPrinter.cpp +++ b/lib/Target/MSP430/MSP430AsmPrinter.cpp @@ -55,7 +55,7 @@ namespace { void printSrcMemOperand(const MachineInstr *MI, int OpNum, const char* Modifier = 0); void printCCOperand(const MachineInstr *MI, int OpNum); - bool printInstruction(const MachineInstr *MI); // autogenerated. + void printInstruction(const MachineInstr *MI); // autogenerated. void printMachineInstruction(const MachineInstr * MI); void emitFunctionHeader(const MachineFunction &MF); diff --git a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp index 121c7ca333f..bcdbe008d6c 100644 --- a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp +++ b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp @@ -79,7 +79,7 @@ namespace { void emitFunctionEnd(MachineFunction &MF); void emitFrameDirective(MachineFunction &MF); - bool printInstruction(const MachineInstr *MI); // autogenerated. + void printInstruction(const MachineInstr *MI); // autogenerated. bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); }; diff --git a/lib/Target/PIC16/PIC16AsmPrinter.h b/lib/Target/PIC16/PIC16AsmPrinter.h index 19c490f78fe..b7a50a9befc 100644 --- a/lib/Target/PIC16/PIC16AsmPrinter.h +++ b/lib/Target/PIC16/PIC16AsmPrinter.h @@ -45,7 +45,7 @@ namespace llvm { bool runOnMachineFunction(MachineFunction &F); void printOperand(const MachineInstr *MI, int opNum); void printCCOperand(const MachineInstr *MI, int opNum); - bool printInstruction(const MachineInstr *MI); // definition autogenerated. + void printInstruction(const MachineInstr *MI); // definition autogenerated. bool printMachineInstruction(const MachineInstr *MI); void EmitFunctionDecls (Module &M); void EmitUndefinedVars (Module &M); diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp index 8a0c767db58..9884ca32bfa 100644 --- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp @@ -116,7 +116,7 @@ namespace { /// from the instruction set description. This method returns true if the /// machine instruction was sufficiently described to print it, otherwise it /// returns false. - bool printInstruction(const MachineInstr *MI); + void printInstruction(const MachineInstr *MI); void printMachineInstruction(const MachineInstr *MI); void printOp(const MachineOperand &MO); diff --git a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp index b12edffc76e..ff11cdf0391 100644 --- a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp @@ -65,7 +65,7 @@ namespace { const char *Modifier = 0); void printCCOperand(const MachineInstr *MI, int opNum); - bool printInstruction(const MachineInstr *MI); // autogenerated. + void printInstruction(const MachineInstr *MI); // autogenerated. bool runOnMachineFunction(MachineFunction &F); bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode); diff --git a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp index 2c73517db9b..00ebf4c9381 100644 --- a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp +++ b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp @@ -63,7 +63,7 @@ namespace { O << (int32_t)MI->getOperand(OpNum).getImm(); } - bool printInstruction(const MachineInstr *MI); // autogenerated. + void printInstruction(const MachineInstr *MI); // autogenerated. void printMachineInstruction(const MachineInstr * MI); void emitFunctionHeader(const MachineFunction &MF); diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h index 65ef5ff6e4b..7839b74ce68 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h @@ -61,11 +61,11 @@ class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter { /// from the instruction set description. This method returns true if the /// machine instruction was sufficiently described to print it, otherwise it /// returns false. - bool printInstruction(const MachineInstr *MI); + void printInstruction(const MachineInstr *MI); // New MCInst printing stuff. - bool printInstruction(const MCInst *MI); + void printInstruction(const MCInst *MI); void printSymbolOperand(const MachineOperand &MO); void printOperand(const MCInst *MI, unsigned OpNo, diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h index 8f12381ceb4..c7c5df20890 100644 --- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h +++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h @@ -37,7 +37,7 @@ struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter { /// from the instruction set description. This method returns true if the /// machine instruction was sufficiently described to print it, otherwise it /// returns false. - bool printInstruction(const MachineInstr *MI); + void printInstruction(const MachineInstr *MI); // This method is used by the tablegen'erated instruction printer. void printOperand(const MachineInstr *MI, unsigned OpNo, diff --git a/lib/Target/XCore/XCoreAsmPrinter.cpp b/lib/Target/XCore/XCoreAsmPrinter.cpp index 1b08c5f4c37..4604b74c833 100644 --- a/lib/Target/XCore/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/XCoreAsmPrinter.cpp @@ -77,7 +77,7 @@ namespace { void emitFunctionStart(MachineFunction &MF); void emitFunctionEnd(MachineFunction &MF); - bool printInstruction(const MachineInstr *MI); // autogenerated. + void printInstruction(const MachineInstr *MI); // autogenerated. void printMachineInstruction(const MachineInstr *MI); bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp index 95d4aac1300..61117c16a31 100644 --- a/utils/TableGen/AsmWriterEmitter.cpp +++ b/utils/TableGen/AsmWriterEmitter.cpp @@ -451,7 +451,7 @@ FindUniqueOperandCommands(std::vector &UniqueOperandCommands, // If this is the last operand, emit a return. if (Inst->Operands.size() == 1) - Command += " return true;\n"; + Command += " return;\n"; // Check to see if we already have 'Command' in UniqueOperandCommands. // If not, add it. @@ -529,7 +529,7 @@ FindUniqueOperandCommands(std::vector &UniqueOperandCommands, // Don't early-out too soon. Other instructions in this // group may have more operands. FirstInst->Operands.size() == MaxSize) { - Command += " return true;\n"; + Command += " return;\n"; } UniqueOperandCommands[CommandIdx] += Command; @@ -565,7 +565,7 @@ void AsmWriterEmitter::run(raw_ostream &O) { "/// from the instruction set description. This method returns true if the\n" "/// machine instruction was sufficiently described to print it, otherwise\n" "/// it returns false.\n" - "bool " << Target.getName() << ClassName + "void " << Target.getName() << ClassName << "::printInstruction(const MachineInstr *MI) {\n"; std::vector Instructions; @@ -640,7 +640,7 @@ void AsmWriterEmitter::run(raw_ostream &O) { // For the first operand check, add a default value for instructions with // just opcode strings to use. if (isFirst) { - UniqueOperandCommands.push_back(" return true;\n"); + UniqueOperandCommands.push_back(" return;\n"); isFirst = false; } @@ -733,16 +733,16 @@ void AsmWriterEmitter::run(raw_ostream &O) { O << " if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n" << " O << \"\\t\";\n" << " printInlineAsm(MI);\n" - << " return true;\n" + << " return;\n" << " } else if (MI->isLabel()) {\n" << " printLabel(MI);\n" - << " return true;\n" + << " return;\n" << " } else if (MI->getOpcode() == TargetInstrInfo::DECLARE) {\n" << " printDeclare(MI);\n" - << " return true;\n" + << " return;\n" << " } else if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) {\n" << " printImplicitDef(MI);\n" - << " return true;\n" + << " return;\n" << " }\n\n"; O << "\n#endif\n"; @@ -751,7 +751,7 @@ void AsmWriterEmitter::run(raw_ostream &O) { O << " // Emit the opcode for the instruction.\n" << " unsigned Bits = OpInfo[MI->getOpcode()];\n" - << " if (Bits == 0) return false;\n" + << " assert(Bits != 0 && \"Cannot print this instruction.\");\n" << " O << AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << ");\n\n"; // Output the table driven operand information. @@ -815,9 +815,9 @@ void AsmWriterEmitter::run(raw_ostream &O) { EmitInstructions(Instructions, O); O << " }\n"; - O << " return true;\n"; + O << " return;\n"; } - O << " return true;\n"; + O << " return;\n"; O << "}\n"; }