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