llvm.org GIT mirror llvm / 038f3e3
[ms-inline asm] Add an interface to the GetMCInstOperandNum() function in the MCTargetAsmParser class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163122 91177308-0d34-0410-b5e6-96231b3b80d8 Chad Rosier 7 years ago
6 changed file(s) with 40 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
110110 return Match_Success;
111111 }
112112
113 virtual unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
114 const SmallVectorImpl &Operands,
115 unsigned OperandNum) = 0;
113116 };
114117
115118 } // End llvm namespace
261261 bool MatchAndEmitInstruction(SMLoc IDLoc,
262262 SmallVectorImpl &Operands,
263263 MCStreamer &Out);
264
265 unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
266 const SmallVectorImpl &Operands,
267 unsigned OperandNum) {
268 return GetMCInstOperandNumImpl(Kind, Inst, Operands, OperandNum);
269 }
264270 };
265271 } // end anonymous namespace
266272
5555
5656 /// }
5757
58 unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
59 const SmallVectorImpl &Operands,
60 unsigned OperandNum) {
61 return GetMCInstOperandNumImpl(Kind, Inst, Operands, OperandNum);
62 }
5863
5964 public:
6065 MBlazeAsmParser(MCSubtargetInfo &_STI, MCAsmParser &_Parser)
3636 bool ParseDirective(AsmToken DirectiveID);
3737
3838 OperandMatchResultTy parseMemOperand(SmallVectorImpl&);
39
40 unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
41 const SmallVectorImpl &Operands,
42 unsigned OperandNum);
43
3944 public:
4045 MipsAsmParser(MCSubtargetInfo &sti, MCAsmParser &parser)
4146 : MCTargetAsmParser() {
95100 };
96101 }
97102
103 unsigned MipsAsmParser::
104 GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
105 const SmallVectorImpl &Operands,
106 unsigned OperandNum) {
107 assert (0 && "GetMCInstOperandNum() not supported by the Mips target.");
108 return 0;
109 }
110
98111 bool MipsAsmParser::
99112 MatchAndEmitInstruction(SMLoc IDLoc,
100113 SmallVectorImpl &Operands,
7171 SmallVectorImpl &MCInsts,
7272 unsigned &OrigErrorInfo,
7373 bool matchingInlineAsm = false);
74
75 unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
76 const SmallVectorImpl &Operands,
77 unsigned OperandNum) {
78 return GetMCInstOperandNumImpl(Kind, Inst, Operands, OperandNum);
79 }
7480
7581 /// isSrcOp - Returns true if operand is either (%rsi) or %ds:%(rsi)
7682 /// in 64bit mode or (%esi) or %es:(%esi) in 32bit mode.
17001700 raw_string_ostream OpOS(OperandFnBody);
17011701 // Start the operand number lookup function.
17021702 OpOS << "unsigned " << Target.getName() << ClassName << "::\n"
1703 << "GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n"
1704 << " const SmallVectorImpl "
1705 << "&Operands,\n unsigned OperandNum) {\n"
1703 << "GetMCInstOperandNumImpl(unsigned Kind, MCInst &Inst,\n"
1704 << " const SmallVectorImpl "
1705 << "&Operands,\n unsigned OperandNum) {\n"
17061706 << " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n"
17071707 << " unsigned MCOperandNum = 0;\n"
17081708 << " uint8_t *Converter = ConversionTable[Kind];\n"
25792579 << "unsigned Opcode,\n"
25802580 << " const SmallVectorImpl "
25812581 << "&Operands);\n";
2582 OS << " unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n "
2583 << " const SmallVectorImpl "
2584 << "&Operands,\n unsigned OperandNum);\n";
2582 OS << " unsigned GetMCInstOperandNumImpl(unsigned Kind, MCInst &Inst,\n "
2583 << " const "
2584 << "SmallVectorImpl &Operands,\n "
2585 << " unsigned OperandNum);\n";
25852586 OS << " bool MnemonicIsValid(StringRef Mnemonic);\n";
25862587 OS << " unsigned MatchInstructionImpl(\n"
25872588 << " const SmallVectorImpl &Operands,\n"