diff options
Diffstat (limited to 'contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp')
-rw-r--r-- | contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp b/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp index 2c222b3..9312fe8 100644 --- a/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -438,7 +438,7 @@ void Filter::recurse() { for (bitIndex = 0; bitIndex < NumBits; bitIndex++) BitValueArray[StartBit + bitIndex] = BIT_UNSET; - // Delegates to an inferior filter chooser for futher processing on this + // Delegates to an inferior filter chooser for further processing on this // group of instructions whose segment values are variable. FilterChooserMap.insert(std::pair<unsigned, FilterChooser*>( (unsigned)-1, @@ -471,7 +471,7 @@ void Filter::recurse() { BitValueArray[StartBit + bitIndex] = BIT_FALSE; } - // Delegates to an inferior filter chooser for futher processing on this + // Delegates to an inferior filter chooser for further processing on this // category of instructions. FilterChooserMap.insert(std::pair<unsigned, FilterChooser*>( mapIterator->first, @@ -611,7 +611,8 @@ void FilterChooser::emitTop(raw_ostream &o, unsigned Indentation) { o << '\n'; o.indent(Indentation) << - "static bool decodeInstruction(MCInst &MI, field_t insn) {\n"; + "static bool decodeInstruction(MCInst &MI, field_t insn, " + "uint64_t Address, const void *Decoder) {\n"; o.indent(Indentation) << " unsigned tmp = 0;\n"; ++Indentation; ++Indentation; @@ -795,7 +796,8 @@ bool FilterChooser::emitSingletonDecoder(raw_ostream &o, unsigned &Indentation, I = InsnOperands.begin(), E = InsnOperands.end(); I != E; ++I) { // If a custom instruction decoder was specified, use that. if (I->FieldBase == ~0U && I->FieldLength == ~0U) { - o.indent(Indentation) << " " << I->Decoder << "(MI, insn);\n"; + o.indent(Indentation) << " " << I->Decoder + << "(MI, insn, Address, Decoder);\n"; break; } @@ -803,7 +805,8 @@ bool FilterChooser::emitSingletonDecoder(raw_ostream &o, unsigned &Indentation, << " tmp = fieldFromInstruction(insn, " << I->FieldBase << ", " << I->FieldLength << ");\n"; if (I->Decoder != "") { - o.indent(Indentation) << " " << I->Decoder << "(MI, tmp);\n"; + o.indent(Indentation) << " " << I->Decoder + << "(MI, tmp, Address, Decoder);\n"; } else { o.indent(Indentation) << " MI.addOperand(MCOperand::CreateImm(tmp));\n"; @@ -846,7 +849,8 @@ bool FilterChooser::emitSingletonDecoder(raw_ostream &o, unsigned &Indentation, I = InsnOperands.begin(), E = InsnOperands.end(); I != E; ++I) { // If a custom instruction decoder was specified, use that. if (I->FieldBase == ~0U && I->FieldLength == ~0U) { - o.indent(Indentation) << " " << I->Decoder << "(MI, insn);\n"; + o.indent(Indentation) << " " << I->Decoder + << "(MI, insn, Address, Decoder);\n"; break; } @@ -854,7 +858,8 @@ bool FilterChooser::emitSingletonDecoder(raw_ostream &o, unsigned &Indentation, << " tmp = fieldFromInstruction(insn, " << I->FieldBase << ", " << I->FieldLength << ");\n"; if (I->Decoder != "") { - o.indent(Indentation) << " " << I->Decoder << "(MI, tmp);\n"; + o.indent(Indentation) << " " << I->Decoder + << "(MI, tmp, Address, Decoder);\n"; } else { o.indent(Indentation) << " MI.addOperand(MCOperand::CreateImm(tmp));\n"; @@ -1224,7 +1229,8 @@ bool FixedLenDecoderEmitter::populateInstruction(const CodeGenInstruction &CGI, if (Bits.allInComplete()) return false; // Ignore "asm parser only" instructions. - if (Def.getValueAsBit("isAsmParserOnly")) + if (Def.getValueAsBit("isAsmParserOnly") || + Def.getValueAsBit("isCodeGenOnly")) return false; std::vector<OperandInfo> InsnOperands; |