llvm.org GIT mirror llvm / 5755715
Enhance the fixed-length disassembler to support the callbacks necessary for symbolic disassembly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129708 91177308-0d34-0410-b5e6-96231b3b80d8 Owen Anderson 9 years ago
1 changed file(s) with 10 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
610610 o << '\n';
611611
612612 o.indent(Indentation) <<
613 "static bool decodeInstruction(MCInst &MI, field_t insn) {\n";
613 "static bool decodeInstruction(MCInst &MI, field_t insn, "
614 "uint64_t Address, const void *Decoder) {\n";
614615 o.indent(Indentation) << " unsigned tmp = 0;\n";
615616
616617 ++Indentation; ++Indentation;
794795 I = InsnOperands.begin(), E = InsnOperands.end(); I != E; ++I) {
795796 // If a custom instruction decoder was specified, use that.
796797 if (I->FieldBase == ~0U && I->FieldLength == ~0U) {
797 o.indent(Indentation) << " " << I->Decoder << "(MI, insn);\n";
798 o.indent(Indentation) << " " << I->Decoder
799 << "(MI, insn, Address, Decoder);\n";
798800 break;
799801 }
800802
802804 << " tmp = fieldFromInstruction(insn, " << I->FieldBase
803805 << ", " << I->FieldLength << ");\n";
804806 if (I->Decoder != "") {
805 o.indent(Indentation) << " " << I->Decoder << "(MI, tmp);\n";
807 o.indent(Indentation) << " " << I->Decoder
808 << "(MI, tmp, Address, Decoder);\n";
806809 } else {
807810 o.indent(Indentation)
808811 << " MI.addOperand(MCOperand::CreateImm(tmp));\n";
845848 I = InsnOperands.begin(), E = InsnOperands.end(); I != E; ++I) {
846849 // If a custom instruction decoder was specified, use that.
847850 if (I->FieldBase == ~0U && I->FieldLength == ~0U) {
848 o.indent(Indentation) << " " << I->Decoder << "(MI, insn);\n";
851 o.indent(Indentation) << " " << I->Decoder
852 << "(MI, insn, Address, Decoder);\n";
849853 break;
850854 }
851855
853857 << " tmp = fieldFromInstruction(insn, " << I->FieldBase
854858 << ", " << I->FieldLength << ");\n";
855859 if (I->Decoder != "") {
856 o.indent(Indentation) << " " << I->Decoder << "(MI, tmp);\n";
860 o.indent(Indentation) << " " << I->Decoder
861 << "(MI, tmp, Address, Decoder);\n";
857862 } else {
858863 o.indent(Indentation)
859864 << " MI.addOperand(MCOperand::CreateImm(tmp));\n";