llvm.org GIT mirror llvm / 41aefdc
make printInstruction return void since its result is omitted. Make the error condition get trapped with an assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78449 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
14 changed file(s) with 27 addition(s) and 27 deletion(s). Raw diff Collapse all Expand all
169169 const char *ExtraCode);
170170
171171 void PrintGlobalVariable(const GlobalVariable* GVar);
172 bool printInstruction(const MachineInstr *MI); // autogenerated.
172 void printInstruction(const MachineInstr *MI); // autogenerated.
173173 void printMachineInstruction(const MachineInstr *MI);
174174 bool runOnMachineFunction(MachineFunction &F);
175175 bool doInitialization(Module &M);
4545 virtual const char *getPassName() const {
4646 return "Alpha Assembly Printer";
4747 }
48 bool printInstruction(const MachineInstr *MI);
48 void printInstruction(const MachineInstr *MI);
4949 void printOp(const MachineOperand &MO, bool IsCallOp = false);
5050 void printOperand(const MachineInstr *MI, int opNum);
5151 void printBaseOffsetPair(const MachineInstr *MI, int i, bool brackets=true);
4747
4848 void printOperand(const MachineInstr *MI, int opNum);
4949 void printMemoryOperand(const MachineInstr *MI, int opNum);
50 bool printInstruction(const MachineInstr *MI); // autogenerated.
50 void printInstruction(const MachineInstr *MI); // autogenerated.
5151 void emitLinkage(const std::string &n, GlobalValue::LinkageTypes l);
5252 bool runOnMachineFunction(MachineFunction &F);
5353 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
6666 /// from the instruction set description. This method returns true if the
6767 /// machine instruction was sufficiently described to print it, otherwise it
6868 /// returns false.
69 bool printInstruction(const MachineInstr *MI);
69 void printInstruction(const MachineInstr *MI);
7070
7171 void printMachineInstruction(const MachineInstr *MI);
7272 void printOp(const MachineOperand &MO);
5454 void printSrcMemOperand(const MachineInstr *MI, int OpNum,
5555 const char* Modifier = 0);
5656 void printCCOperand(const MachineInstr *MI, int OpNum);
57 bool printInstruction(const MachineInstr *MI); // autogenerated.
57 void printInstruction(const MachineInstr *MI); // autogenerated.
5858 void printMachineInstruction(const MachineInstr * MI);
5959
6060 void emitFunctionHeader(const MachineFunction &MF);
7878 void emitFunctionEnd(MachineFunction &MF);
7979 void emitFrameDirective(MachineFunction &MF);
8080
81 bool printInstruction(const MachineInstr *MI); // autogenerated.
81 void printInstruction(const MachineInstr *MI); // autogenerated.
8282 bool runOnMachineFunction(MachineFunction &F);
8383 bool doInitialization(Module &M);
8484 };
4444 bool runOnMachineFunction(MachineFunction &F);
4545 void printOperand(const MachineInstr *MI, int opNum);
4646 void printCCOperand(const MachineInstr *MI, int opNum);
47 bool printInstruction(const MachineInstr *MI); // definition autogenerated.
47 void printInstruction(const MachineInstr *MI); // definition autogenerated.
4848 bool printMachineInstruction(const MachineInstr *MI);
4949 void EmitFunctionDecls (Module &M);
5050 void EmitUndefinedVars (Module &M);
115115 /// from the instruction set description. This method returns true if the
116116 /// machine instruction was sufficiently described to print it, otherwise it
117117 /// returns false.
118 bool printInstruction(const MachineInstr *MI);
118 void printInstruction(const MachineInstr *MI);
119119
120120 void printMachineInstruction(const MachineInstr *MI);
121121 void printOp(const MachineOperand &MO);
6464 const char *Modifier = 0);
6565 void printCCOperand(const MachineInstr *MI, int opNum);
6666
67 bool printInstruction(const MachineInstr *MI); // autogenerated.
67 void printInstruction(const MachineInstr *MI); // autogenerated.
6868 bool runOnMachineFunction(MachineFunction &F);
6969 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
7070 unsigned AsmVariant, const char *ExtraCode);
6262 O << (int32_t)MI->getOperand(OpNum).getImm();
6363 }
6464
65 bool printInstruction(const MachineInstr *MI); // autogenerated.
65 void printInstruction(const MachineInstr *MI); // autogenerated.
6666 void printMachineInstruction(const MachineInstr * MI);
6767
6868 void emitFunctionHeader(const MachineFunction &MF);
6060 /// from the instruction set description. This method returns true if the
6161 /// machine instruction was sufficiently described to print it, otherwise it
6262 /// returns false.
63 bool printInstruction(const MachineInstr *MI);
63 void printInstruction(const MachineInstr *MI);
6464
6565
6666 // New MCInst printing stuff.
67 bool printInstruction(const MCInst *MI);
67 void printInstruction(const MCInst *MI);
6868
6969 void printSymbolOperand(const MachineOperand &MO);
7070 void printOperand(const MCInst *MI, unsigned OpNo,
3636 /// from the instruction set description. This method returns true if the
3737 /// machine instruction was sufficiently described to print it, otherwise it
3838 /// returns false.
39 bool printInstruction(const MachineInstr *MI);
39 void printInstruction(const MachineInstr *MI);
4040
4141 // This method is used by the tablegen'erated instruction printer.
4242 void printOperand(const MachineInstr *MI, unsigned OpNo,
7676 void emitFunctionStart(MachineFunction &MF);
7777 void emitFunctionEnd(MachineFunction &MF);
7878
79 bool printInstruction(const MachineInstr *MI); // autogenerated.
79 void printInstruction(const MachineInstr *MI); // autogenerated.
8080 void printMachineInstruction(const MachineInstr *MI);
8181 bool runOnMachineFunction(MachineFunction &F);
8282 bool doInitialization(Module &M);
450450
451451 // If this is the last operand, emit a return.
452452 if (Inst->Operands.size() == 1)
453 Command += " return true;\n";
453 Command += " return;\n";
454454
455455 // Check to see if we already have 'Command' in UniqueOperandCommands.
456456 // If not, add it.
528528 // Don't early-out too soon. Other instructions in this
529529 // group may have more operands.
530530 FirstInst->Operands.size() == MaxSize) {
531 Command += " return true;\n";
531 Command += " return;\n";
532532 }
533533
534534 UniqueOperandCommands[CommandIdx] += Command;
564564 "/// from the instruction set description. This method returns true if the\n"
565565 "/// machine instruction was sufficiently described to print it, otherwise\n"
566566 "/// it returns false.\n"
567 "bool " << Target.getName() << ClassName
567 "void " << Target.getName() << ClassName
568568 << "::printInstruction(const MachineInstr *MI) {\n";
569569
570570 std::vector Instructions;
639639 // For the first operand check, add a default value for instructions with
640640 // just opcode strings to use.
641641 if (isFirst) {
642 UniqueOperandCommands.push_back(" return true;\n");
642 UniqueOperandCommands.push_back(" return;\n");
643643 isFirst = false;
644644 }
645645
732732 O << " if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"
733733 << " O << \"\\t\";\n"
734734 << " printInlineAsm(MI);\n"
735 << " return true;\n"
735 << " return;\n"
736736 << " } else if (MI->isLabel()) {\n"
737737 << " printLabel(MI);\n"
738 << " return true;\n"
738 << " return;\n"
739739 << " } else if (MI->getOpcode() == TargetInstrInfo::DECLARE) {\n"
740740 << " printDeclare(MI);\n"
741 << " return true;\n"
741 << " return;\n"
742742 << " } else if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) {\n"
743743 << " printImplicitDef(MI);\n"
744 << " return true;\n"
744 << " return;\n"
745745 << " }\n\n";
746746
747747 O << "\n#endif\n";
750750
751751 O << " // Emit the opcode for the instruction.\n"
752752 << " unsigned Bits = OpInfo[MI->getOpcode()];\n"
753 << " if (Bits == 0) return false;\n"
753 << " assert(Bits != 0 && \"Cannot print this instruction.\");\n"
754754 << " O << AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << ");\n\n";
755755
756756 // Output the table driven operand information.
814814 EmitInstructions(Instructions, O);
815815
816816 O << " }\n";
817 O << " return true;\n";
818 }
819
820 O << " return true;\n";
817 O << " return;\n";
818 }
819
820 O << " return;\n";
821821 O << "}\n";
822822 }