mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-02 00:35:27 +00:00
[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
This commit is contained in:
parent
ad2d3e637a
commit
038f3e3127
@ -111,6 +111,9 @@ public:
|
||||
return Match_Success;
|
||||
}
|
||||
|
||||
virtual unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
|
||||
const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
unsigned OperandNum) = 0;
|
||||
};
|
||||
|
||||
} // End llvm namespace
|
||||
|
@ -262,6 +262,12 @@ public:
|
||||
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
MCStreamer &Out);
|
||||
|
||||
unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
|
||||
const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
unsigned OperandNum) {
|
||||
return GetMCInstOperandNumImpl(Kind, Inst, Operands, OperandNum);
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
|
@ -56,6 +56,11 @@ class MBlazeAsmParser : public MCTargetAsmParser {
|
||||
|
||||
/// }
|
||||
|
||||
unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
|
||||
const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
unsigned OperandNum) {
|
||||
return GetMCInstOperandNumImpl(Kind, Inst, Operands, OperandNum);
|
||||
}
|
||||
|
||||
public:
|
||||
MBlazeAsmParser(MCSubtargetInfo &_STI, MCAsmParser &_Parser)
|
||||
|
@ -37,6 +37,11 @@ class MipsAsmParser : public MCTargetAsmParser {
|
||||
bool ParseDirective(AsmToken DirectiveID);
|
||||
|
||||
OperandMatchResultTy parseMemOperand(SmallVectorImpl<MCParsedAsmOperand*>&);
|
||||
|
||||
unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
|
||||
const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
unsigned OperandNum);
|
||||
|
||||
public:
|
||||
MipsAsmParser(MCSubtargetInfo &sti, MCAsmParser &parser)
|
||||
: MCTargetAsmParser() {
|
||||
@ -96,6 +101,14 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
unsigned MipsAsmParser::
|
||||
GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
|
||||
const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
unsigned OperandNum) {
|
||||
assert (0 && "GetMCInstOperandNum() not supported by the Mips target.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool MipsAsmParser::
|
||||
MatchAndEmitInstruction(SMLoc IDLoc,
|
||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
|
@ -73,6 +73,12 @@ private:
|
||||
unsigned &OrigErrorInfo,
|
||||
bool matchingInlineAsm = false);
|
||||
|
||||
unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,
|
||||
const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
unsigned OperandNum) {
|
||||
return GetMCInstOperandNumImpl(Kind, Inst, Operands, OperandNum);
|
||||
}
|
||||
|
||||
/// isSrcOp - Returns true if operand is either (%rsi) or %ds:%(rsi)
|
||||
/// in 64bit mode or (%esi) or %es:(%esi) in 32bit mode.
|
||||
bool isSrcOp(X86Operand &Op);
|
||||
|
@ -1701,9 +1701,9 @@ static void emitConvertToMCInst(CodeGenTarget &Target, StringRef ClassName,
|
||||
raw_string_ostream OpOS(OperandFnBody);
|
||||
// Start the operand number lookup function.
|
||||
OpOS << "unsigned " << Target.getName() << ClassName << "::\n"
|
||||
<< "GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n"
|
||||
<< " const SmallVectorImpl<MCParsedAsmOperand*> "
|
||||
<< "&Operands,\n unsigned OperandNum) {\n"
|
||||
<< "GetMCInstOperandNumImpl(unsigned Kind, MCInst &Inst,\n"
|
||||
<< " const SmallVectorImpl<MCParsedAsmOperand*> "
|
||||
<< "&Operands,\n unsigned OperandNum) {\n"
|
||||
<< " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n"
|
||||
<< " unsigned MCOperandNum = 0;\n"
|
||||
<< " uint8_t *Converter = ConversionTable[Kind];\n"
|
||||
@ -2580,9 +2580,10 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
|
||||
<< "unsigned Opcode,\n"
|
||||
<< " const SmallVectorImpl<MCParsedAsmOperand*> "
|
||||
<< "&Operands);\n";
|
||||
OS << " unsigned GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n "
|
||||
<< " const SmallVectorImpl<MCParsedAsmOperand*> "
|
||||
<< "&Operands,\n unsigned OperandNum);\n";
|
||||
OS << " unsigned GetMCInstOperandNumImpl(unsigned Kind, MCInst &Inst,\n "
|
||||
<< " const "
|
||||
<< "SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n "
|
||||
<< " unsigned OperandNum);\n";
|
||||
OS << " bool MnemonicIsValid(StringRef Mnemonic);\n";
|
||||
OS << " unsigned MatchInstructionImpl(\n"
|
||||
<< " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user