reference, declaration → definition definition → references, declarations, derived classes, virtual overrides reference to multiple definitions → definitions unreferenced |
3192 OS << "\n#ifdef GET_ASSEMBLER_HEADER\n"; 3193 OS << "#undef GET_ASSEMBLER_HEADER\n"; 3194 OS << " // This should be included into the middle of the declaration of\n"; 3195 OS << " // your subclasses implementation of MCTargetAsmParser.\n"; 3196 OS << " FeatureBitset ComputeAvailableFeatures(const FeatureBitset& FB) const;\n"; 3198 OS << " void convertToMCInst(unsigned Kind, MCInst &Inst, " 3203 OS << " void convertToMCInst(unsigned Kind, MCInst &Inst, " 3207 OS << " void convertToMapAndConstraints(unsigned Kind,\n "; 3208 OS << " const OperandVector &Operands) override;\n"; 3209 OS << " unsigned MatchInstructionImpl(const OperandVector &Operands,\n" 3212 OS << " SmallVectorImpl<NearMissInfo> *NearMisses,\n"; 3214 OS << " uint64_t &ErrorInfo,\n" 3216 OS << " bool matchingInlineAsm,\n" 3219 OS << " unsigned MatchInstructionImpl(const OperandVector &Operands,\n" 3231 OS << " OperandMatchResultTy MatchOperandParserImpl(\n"; 3232 OS << " OperandVector &Operands,\n"; 3233 OS << " StringRef Mnemonic,\n"; 3234 OS << " bool ParseForAllFeatures = false);\n"; 3236 OS << " OperandMatchResultTy tryCustomParseOperand(\n"; 3237 OS << " OperandVector &Operands,\n"; 3238 OS << " unsigned MCK);\n\n"; 3241 OS << "#endif // GET_ASSEMBLER_HEADER_INFO\n\n"; 3244 OS << "\n#ifdef GET_OPERAND_DIAGNOSTIC_TYPES\n"; 3245 OS << "#undef GET_OPERAND_DIAGNOSTIC_TYPES\n\n"; 3246 emitOperandDiagnosticTypes(Info, OS); 3247 OS << "#endif // GET_OPERAND_DIAGNOSTIC_TYPES\n\n"; 3249 OS << "\n#ifdef GET_REGISTER_MATCHER\n"; 3250 OS << "#undef GET_REGISTER_MATCHER\n\n"; 3254 Info.SubtargetFeatures, OS); 3259 emitMatchRegisterName(Target, AsmParser, OS); 3262 emitMatchRegisterAltName(Target, AsmParser, OS); 3264 OS << "#endif // GET_REGISTER_MATCHER\n\n"; 3266 OS << "\n#ifdef GET_SUBTARGET_FEATURE_NAME\n"; 3267 OS << "#undef GET_SUBTARGET_FEATURE_NAME\n\n"; 3270 emitGetSubtargetFeatureName(Info, OS); 3272 OS << "#endif // GET_SUBTARGET_FEATURE_NAME\n\n"; 3274 OS << "\n#ifdef GET_MATCHER_IMPLEMENTATION\n"; 3275 OS << "#undef GET_MATCHER_IMPLEMENTATION\n\n"; 3278 bool HasMnemonicAliases = emitMnemonicAliases(OS, Info, Target); 3285 HasOptionalOperands, OS); 3288 emitMatchClassEnumeration(Target, Info.Classes, OS); 3292 emitOperandMatchErrorDiagStrings(Info, OS); 3295 emitRegisterMatchErrorFunc(Info, OS); 3298 emitMatchTokenString(Target, Info.Classes, OS); 3301 emitIsSubclass(Target, Info.Classes, OS); 3304 emitValidateOperandClass(Info, OS); 3306 emitMatchClassKindNames(Info.Classes, OS); 3311 Info.SubtargetFeatures, OS); 3314 emitAsmTiedOperandConstraints(Target, Info, OS); 3331 OS << "static const char *const MnemonicTable =\n"; 3332 StringTable.EmitString(OS); 3333 OS << ";\n\n"; 3361 OS << "// Feature bitsets.\n" 3367 OS << " " << getNameForFeatureBitset(FeatureBitset) << ",\n"; 3369 OS << "};\n\n" 3375 OS << " {"; 3379 OS << I->second.getEnumBitName() << ", "; 3381 OS << "},\n"; 3383 OS << "};\n\n"; 3395 OS << "namespace {\n"; 3396 OS << " struct MatchEntry {\n"; 3397 OS << " " << getMinimalTypeForRange(MaxMnemonicIndex) 3399 OS << " uint16_t Opcode;\n"; 3400 OS << " " << getMinimalTypeForRange(NumConverters) 3402 OS << " " << getMinimalTypeForRange(FeatureBitsets.size()) 3404 OS << " " << getMinimalTypeForRange( 3407 OS << " StringRef getMnemonic() const {\n"; 3408 OS << " return StringRef(MnemonicTable + Mnemonic + 1,\n"; 3409 OS << " MnemonicTable[Mnemonic]);\n"; 3410 OS << " }\n"; 3411 OS << " };\n\n"; 3413 OS << " // Predicate for searching for an opcode.\n"; 3414 OS << " struct LessOpcode {\n"; 3415 OS << " bool operator()(const MatchEntry &LHS, StringRef RHS) {\n"; 3416 OS << " return LHS.getMnemonic() < RHS;\n"; 3417 OS << " }\n"; 3418 OS << " bool operator()(StringRef LHS, const MatchEntry &RHS) {\n"; 3419 OS << " return LHS < RHS.getMnemonic();\n"; 3420 OS << " }\n"; 3421 OS << " bool operator()(const MatchEntry &LHS, const MatchEntry &RHS) {\n"; 3422 OS << " return LHS.getMnemonic() < RHS.getMnemonic();\n"; 3423 OS << " }\n"; 3424 OS << " };\n"; 3426 OS << "} // end anonymous namespace\n\n"; 3433 OS << "static const MatchEntry MatchTable" << VC << "[] = {\n"; 3441 OS << " { " << StringTable.GetOrAddStringOffset(LenMnemonic, false) 3448 OS << "AMFBS"; 3450 OS << "_None"; 3453 OS << '_' << MI->RequiredFeatures[i]->TheDef->getName(); 3455 OS << ", { "; 3459 if (i) OS << ", "; 3460 OS << Op.Class->Name; 3462 OS << " }, },\n"; 3465 OS << "};\n\n"; 3468 OS << "#include \"llvm/Support/Debug.h\"\n"; 3469 OS << "#include \"llvm/Support/Format.h\"\n\n"; 3472 OS << "unsigned " << Target.getName() << ClassName << "::\n" 3474 OS << " MCInst &Inst,\n"; 3476 OS << " SmallVectorImpl<NearMissInfo> *NearMisses,\n"; 3478 OS << " uint64_t &ErrorInfo,\n" 3480 OS << " bool matchingInlineAsm, unsigned VariantID) {\n"; 3483 OS << " // Eliminate obvious mismatches.\n"; 3484 OS << " if (Operands.size() > " 3486 OS << " ErrorInfo = " 3488 OS << " return Match_InvalidOperand;\n"; 3489 OS << " }\n\n"; 3493 OS << " // Get the current feature set.\n"; 3494 OS << " const FeatureBitset &AvailableFeatures = getAvailableFeatures();\n\n"; 3496 OS << " // Get the instruction mnemonic, which is the first token.\n"; 3498 OS << " StringRef Mnemonic = ((" << Target.getName() 3501 OS << " StringRef Mnemonic;\n"; 3502 OS << " if (Operands[0]->isToken())\n"; 3503 OS << " Mnemonic = ((" << Target.getName() 3508 OS << " // Process all MnemonicAliases to remap the mnemonic.\n"; 3509 OS << " applyMnemonicAliases(Mnemonic, AvailableFeatures, VariantID);\n\n"; 3514 OS << " // Some state to try to produce better error messages.\n"; 3515 OS << " bool HadMatchOtherThanFeatures = false;\n"; 3516 OS << " bool HadMatchOtherThanPredicate = false;\n"; 3517 OS << " unsigned RetCode = Match_InvalidOperand;\n"; 3518 OS << " MissingFeatures.set();\n"; 3519 OS << " // Set ErrorInfo to the operand that mismatches if it is\n"; 3520 OS << " // wrong for all instances of the instruction.\n"; 3521 OS << " ErrorInfo = ~0ULL;\n"; 3525 OS << " SmallBitVector OptionalOperandsMask(" << MaxNumOperands << ");\n"; 3529 OS << " // Find the appropriate table for this asm variant.\n"; 3530 OS << " const MatchEntry *Start, *End;\n"; 3531 OS << " switch (VariantID) {\n"; 3532 OS << " default: llvm_unreachable(\"invalid variant!\");\n"; 3536 OS << " case " << AsmVariantNo << ": Start = std::begin(MatchTable" << VC 3539 OS << " }\n"; 3541 OS << " // Search the table.\n"; 3543 OS << " auto MnemonicRange = " 3546 OS << " auto MnemonicRange = std::make_pair(Start, End);\n"; 3547 OS << " unsigned SIndex = Mnemonic.empty() ? 0 : 1;\n"; 3548 OS << " if (!Mnemonic.empty())\n"; 3549 OS << " MnemonicRange = " 3553 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"AsmMatcher: found \" <<\n" 3557 OS << " // Return a more specific error code if no mnemonics match.\n"; 3558 OS << " if (MnemonicRange.first == MnemonicRange.second)\n"; 3559 OS << " return Match_MnemonicFail;\n\n"; 3561 OS << " for (const MatchEntry *it = MnemonicRange.first, " 3563 OS << " it != ie; ++it) {\n"; 3564 OS << " const FeatureBitset &RequiredFeatures = " 3566 OS << " bool HasRequiredFeatures =\n"; 3567 OS << " (AvailableFeatures & RequiredFeatures) == RequiredFeatures;\n"; 3568 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"Trying to match opcode \"\n"; 3569 OS << " << MII.getName(it->Opcode) << \"\\n\");\n"; 3572 OS << " // Some state to record ways in which this instruction did not match.\n"; 3573 OS << " NearMissInfo OperandNearMiss = NearMissInfo::getSuccess();\n"; 3574 OS << " NearMissInfo FeaturesNearMiss = NearMissInfo::getSuccess();\n"; 3575 OS << " NearMissInfo EarlyPredicateNearMiss = NearMissInfo::getSuccess();\n"; 3576 OS << " NearMissInfo LatePredicateNearMiss = NearMissInfo::getSuccess();\n"; 3577 OS << " bool MultipleInvalidOperands = false;\n"; 3581 OS << " // equal_range guarantees that instruction mnemonic matches.\n"; 3582 OS << " assert(Mnemonic == it->getMnemonic());\n"; 3587 OS << " bool OperandsValid = true;\n"; 3589 OS << " OptionalOperandsMask.reset(0, " << MaxNumOperands << ");\n"; 3591 OS << " for (unsigned FormalIdx = " << (HasMnemonicFirst ? "0" : "SIndex") 3594 OS << " auto Formal = " 3596 OS << " DEBUG_WITH_TYPE(\"asm-matcher\",\n"; 3597 OS << " dbgs() << \" Matching formal operand class \" << getMatchClassName(Formal)\n"; 3598 OS << " << \" against actual operand at index \" << ActualIdx);\n"; 3599 OS << " if (ActualIdx < Operands.size())\n"; 3600 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \" (\";\n"; 3601 OS << " Operands[ActualIdx]->print(dbgs()); dbgs() << \"): \");\n"; 3602 OS << " else\n"; 3603 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \": \");\n"; 3604 OS << " if (ActualIdx >= Operands.size()) {\n"; 3605 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"actual operand index out of range \");\n"; 3607 OS << " bool ThisOperandValid = (Formal == " <<"InvalidMatchClass) || " 3609 OS << " if (!ThisOperandValid) {\n"; 3610 OS << " if (!OperandNearMiss) {\n"; 3611 OS << " // Record info about match failure for later use.\n"; 3612 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"recording too-few-operands near miss\\n\");\n"; 3613 OS << " OperandNearMiss =\n"; 3614 OS << " NearMissInfo::getTooFewOperands(Formal, it->Opcode);\n"; 3615 OS << " } else if (OperandNearMiss.getKind() != NearMissInfo::NearMissTooFewOperands) {\n"; 3616 OS << " // If more than one operand is invalid, give up on this match entry.\n"; 3617 OS << " DEBUG_WITH_TYPE(\n"; 3618 OS << " \"asm-matcher\",\n"; 3619 OS << " dbgs() << \"second invalid operand, giving up on this opcode\\n\");\n"; 3620 OS << " MultipleInvalidOperands = true;\n"; 3621 OS << " break;\n"; 3622 OS << " }\n"; 3623 OS << " } else {\n"; 3624 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"but formal operand not required\\n\");\n"; 3625 OS << " break;\n"; 3626 OS << " }\n"; 3627 OS << " continue;\n"; 3629 OS << " OperandsValid = (Formal == InvalidMatchClass) || isSubclass(Formal, OptionalMatchClass);\n"; 3630 OS << " if (!OperandsValid) ErrorInfo = ActualIdx;\n"; 3632 OS << " OptionalOperandsMask.set(FormalIdx, " << MaxNumOperands 3635 OS << " break;\n"; 3637 OS << " }\n"; 3638 OS << " MCParsedAsmOperand &Actual = *Operands[ActualIdx];\n"; 3639 OS << " unsigned Diag = validateOperandClass(Actual, Formal);\n"; 3640 OS << " if (Diag == Match_Success) {\n"; 3641 OS << " DEBUG_WITH_TYPE(\"asm-matcher\",\n"; 3642 OS << " dbgs() << \"match success using generic matcher\\n\");\n"; 3643 OS << " ++ActualIdx;\n"; 3644 OS << " continue;\n"; 3645 OS << " }\n"; 3646 OS << " // If the generic handler indicates an invalid operand\n"; 3647 OS << " // failure, check for a special case.\n"; 3648 OS << " if (Diag != Match_Success) {\n"; 3649 OS << " unsigned TargetDiag = validateTargetOperandClass(Actual, Formal);\n"; 3650 OS << " if (TargetDiag == Match_Success) {\n"; 3651 OS << " DEBUG_WITH_TYPE(\"asm-matcher\",\n"; 3652 OS << " dbgs() << \"match success using target matcher\\n\");\n"; 3653 OS << " ++ActualIdx;\n"; 3654 OS << " continue;\n"; 3655 OS << " }\n"; 3656 OS << " // If the target matcher returned a specific error code use\n"; 3657 OS << " // that, else use the one from the generic matcher.\n"; 3658 OS << " if (TargetDiag != Match_InvalidOperand && " 3660 OS << " Diag = TargetDiag;\n"; 3661 OS << " }\n"; 3662 OS << " // If current formal operand wasn't matched and it is optional\n" 3664 OS << " if (Diag == Match_InvalidOperand " 3667 OS << " OptionalOperandsMask.set(FormalIdx);\n"; 3669 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"ignoring optional operand\\n\");\n"; 3670 OS << " continue;\n"; 3671 OS << " }\n"; 3674 OS << " if (!OperandNearMiss) {\n"; 3675 OS << " // If this is the first invalid operand we have seen, record some\n"; 3676 OS << " // information about it.\n"; 3677 OS << " DEBUG_WITH_TYPE(\n"; 3678 OS << " \"asm-matcher\",\n"; 3679 OS << " dbgs()\n"; 3680 OS << " << \"operand match failed, recording near-miss with diag code \"\n"; 3681 OS << " << Diag << \"\\n\");\n"; 3682 OS << " OperandNearMiss =\n"; 3683 OS << " NearMissInfo::getMissedOperand(Diag, Formal, it->Opcode, ActualIdx);\n"; 3684 OS << " ++ActualIdx;\n"; 3685 OS << " } else {\n"; 3686 OS << " // If more than one operand is invalid, give up on this match entry.\n"; 3687 OS << " DEBUG_WITH_TYPE(\n"; 3688 OS << " \"asm-matcher\",\n"; 3689 OS << " dbgs() << \"second operand mismatch, skipping this opcode\\n\");\n"; 3690 OS << " MultipleInvalidOperands = true;\n"; 3691 OS << " break;\n"; 3692 OS << " }\n"; 3693 OS << " }\n\n"; 3695 OS << " // If this operand is broken for all of the instances of this\n"; 3696 OS << " // mnemonic, keep track of it so we can report loc info.\n"; 3697 OS << " // If we already had a match that only failed due to a\n"; 3698 OS << " // target predicate, that diagnostic is preferred.\n"; 3699 OS << " if (!HadMatchOtherThanPredicate &&\n"; 3700 OS << " (it == MnemonicRange.first || ErrorInfo <= ActualIdx)) {\n"; 3701 OS << " if (HasRequiredFeatures && (ErrorInfo != ActualIdx || Diag " 3703 OS << " RetCode = Diag;\n"; 3704 OS << " ErrorInfo = ActualIdx;\n"; 3705 OS << " }\n"; 3706 OS << " // Otherwise, just reject this instance of the mnemonic.\n"; 3707 OS << " OperandsValid = false;\n"; 3708 OS << " break;\n"; 3709 OS << " }\n\n"; 3713 OS << " if (MultipleInvalidOperands) {\n"; 3715 OS << " if (!OperandsValid) {\n"; 3716 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"Opcode result: multiple \"\n"; 3717 OS << " \"operand mismatches, ignoring \"\n"; 3718 OS << " \"this opcode\\n\");\n"; 3719 OS << " continue;\n"; 3720 OS << " }\n"; 3723 OS << " if (!HasRequiredFeatures) {\n"; 3725 OS << " HadMatchOtherThanFeatures = true;\n"; 3726 OS << " FeatureBitset NewMissingFeatures = RequiredFeatures & " 3728 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"Missing target features:\";\n"; 3729 OS << " for (unsigned I = 0, E = NewMissingFeatures.size(); I != E; ++I)\n"; 3730 OS << " if (NewMissingFeatures[I])\n"; 3731 OS << " dbgs() << ' ' << I;\n"; 3732 OS << " dbgs() << \"\\n\");\n"; 3734 OS << " FeaturesNearMiss = NearMissInfo::getMissedFeature(NewMissingFeatures);\n"; 3736 OS << " if (NewMissingFeatures.count() <=\n" 3738 OS << " MissingFeatures = NewMissingFeatures;\n"; 3739 OS << " continue;\n"; 3741 OS << " }\n"; 3742 OS << "\n"; 3743 OS << " Inst.clear();\n\n"; 3744 OS << " Inst.setOpcode(it->Opcode);\n"; 3746 OS << " // We have a potential match but have not rendered the operands.\n" 3757 OS << " DEBUG_WITH_TYPE(\n"; 3758 OS << " \"asm-matcher\",\n"; 3759 OS << " dbgs() << \"Early target match predicate failed with diag code \"\n"; 3760 OS << " << MatchResult << \"\\n\");\n"; 3762 OS << " EarlyPredicateNearMiss = NearMissInfo::getMissedPredicate(MatchResult);\n"; 3764 OS << " RetCode = MatchResult;\n" 3768 OS << " }\n\n"; 3771 OS << " // If we did not successfully match the operands, then we can't convert to\n"; 3772 OS << " // an MCInst, so bail out on this instruction variant now.\n"; 3773 OS << " if (OperandNearMiss) {\n"; 3774 OS << " // If the operand mismatch was the only problem, reprrt it as a near-miss.\n"; 3775 OS << " if (NearMisses && !FeaturesNearMiss && !EarlyPredicateNearMiss) {\n"; 3776 OS << " DEBUG_WITH_TYPE(\n"; 3777 OS << " \"asm-matcher\",\n"; 3778 OS << " dbgs()\n"; 3779 OS << " << \"Opcode result: one mismatched operand, adding near-miss\\n\");\n"; 3780 OS << " NearMisses->push_back(OperandNearMiss);\n"; 3781 OS << " } else {\n"; 3782 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"Opcode result: multiple \"\n"; 3783 OS << " \"types of mismatch, so not \"\n"; 3784 OS << " \"reporting near-miss\\n\");\n"; 3785 OS << " }\n"; 3786 OS << " continue;\n"; 3787 OS << " }\n\n"; 3790 OS << " if (matchingInlineAsm) {\n"; 3791 OS << " convertToMapAndConstraints(it->ConvertFn, Operands);\n"; 3793 OS << " if (!checkAsmTiedOperandConstraints(*this, it->ConvertFn, " 3795 OS << " return Match_InvalidTiedOperand;\n"; 3796 OS << "\n"; 3798 OS << " return Match_Success;\n"; 3799 OS << " }\n\n"; 3800 OS << " // We have selected a definite instruction, convert the parsed\n" 3803 OS << " convertToMCInst(it->ConvertFn, Inst, it->Opcode, Operands,\n" 3806 OS << " convertToMCInst(it->ConvertFn, Inst, it->Opcode, Operands);\n"; 3808 OS << "\n"; 3811 OS << " // We have a potential match. Check the target predicate to\n" 3820 OS << " LatePredicateNearMiss = NearMissInfo::getMissedPredicate(MatchResult);\n"; 3822 OS << " RetCode = MatchResult;\n" 3826 OS << " }\n\n"; 3829 OS << " int NumNearMisses = ((int)(bool)OperandNearMiss +\n"; 3830 OS << " (int)(bool)FeaturesNearMiss +\n"; 3831 OS << " (int)(bool)EarlyPredicateNearMiss +\n"; 3832 OS << " (int)(bool)LatePredicateNearMiss);\n"; 3833 OS << " if (NumNearMisses == 1) {\n"; 3834 OS << " // We had exactly one type of near-miss, so add that to the list.\n"; 3835 OS << " assert(!OperandNearMiss && \"OperandNearMiss was handled earlier\");\n"; 3836 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"Opcode result: found one type of \"\n"; 3837 OS << " \"mismatch, so reporting a \"\n"; 3838 OS << " \"near-miss\\n\");\n"; 3839 OS << " if (NearMisses && FeaturesNearMiss)\n"; 3840 OS << " NearMisses->push_back(FeaturesNearMiss);\n"; 3841 OS << " else if (NearMisses && EarlyPredicateNearMiss)\n"; 3842 OS << " NearMisses->push_back(EarlyPredicateNearMiss);\n"; 3843 OS << " else if (NearMisses && LatePredicateNearMiss)\n"; 3844 OS << " NearMisses->push_back(LatePredicateNearMiss);\n"; 3845 OS << "\n"; 3846 OS << " continue;\n"; 3847 OS << " } else if (NumNearMisses > 1) {\n"; 3848 OS << " // This instruction missed in more than one way, so ignore it.\n"; 3849 OS << " DEBUG_WITH_TYPE(\"asm-matcher\", dbgs() << \"Opcode result: multiple \"\n"; 3850 OS << " \"types of mismatch, so not \"\n"; 3851 OS << " \"reporting near-miss\\n\");\n"; 3852 OS << " continue;\n"; 3853 OS << " }\n"; 3859 OS << " " << InsnCleanupFn << "(Inst);\n"; 3862 OS << " std::string Info;\n"; 3863 OS << " if (!getParser().getTargetParser().\n"; 3864 OS << " getTargetOptions().MCNoDeprecatedWarn &&\n"; 3865 OS << " MII.get(Inst.getOpcode()).getDeprecatedInfo(Inst, getSTI(), Info)) {\n"; 3866 OS << " SMLoc Loc = ((" << Target.getName() 3868 OS << " getParser().Warning(Loc, Info, None);\n"; 3869 OS << " }\n"; 3873 OS << " if (!checkAsmTiedOperandConstraints(*this, it->ConvertFn, " 3875 OS << " return Match_InvalidTiedOperand;\n"; 3876 OS << "\n"; 3879 OS << " DEBUG_WITH_TYPE(\n"; 3880 OS << " \"asm-matcher\",\n"; 3881 OS << " dbgs() << \"Opcode result: complete match, selecting this opcode\\n\");\n"; 3882 OS << " return Match_Success;\n"; 3883 OS << " }\n\n"; 3886 OS << " // No instruction variants matched exactly.\n"; 3887 OS << " return Match_NearMisses;\n"; 3889 OS << " // Okay, we had no match. Try to return a useful error code.\n"; 3890 OS << " if (HadMatchOtherThanPredicate || !HadMatchOtherThanFeatures)\n"; 3891 OS << " return RetCode;\n\n"; 3892 OS << " ErrorInfo = 0;\n"; 3893 OS << " return Match_MissingFeature;\n"; 3895 OS << "}\n\n"; 3898 emitCustomOperandParsing(OS, Target, Info, ClassName, StringTable, 3902 OS << "#endif // GET_MATCHER_IMPLEMENTATION\n\n"; 3904 OS << "\n#ifdef GET_MNEMONIC_SPELL_CHECKER\n"; 3905 OS << "#undef GET_MNEMONIC_SPELL_CHECKER\n\n"; 3907 emitMnemonicSpellChecker(OS, Target, VariantCount); 3909 OS << "#endif // GET_MNEMONIC_SPELL_CHECKER\n\n";