Hi,
I try to create a backend to support AsmParser, but it hasn't the red part
as below. I find the Mips has this. Do you know how to make it appear?
Jonathan
#ifdef GET_ASSEMBLER_HEADER
#undef GET_ASSEMBLER_HEADER
// This should be included into the middle of the declaration of
// your subclasses implementation of MCTargetAsmParser.
unsigned ComputeAvailableFeatures(uint64_t FeatureBits) const;
void convertToMCInst(unsigned Kind, MCInst &Inst, unsigned Opcode,
const SmallVectorImpl<MCParsedAsmOperand*>
&Operands);
void convertToMapAndConstraints(unsigned Kind,
const SmallVectorImpl<MCParsedAsmOperand*>
&Operands);
bool mnemonicIsValid(StringRef Mnemonic);
unsigned MatchInstructionImpl(
const SmallVectorImpl<MCParsedAsmOperand*>
&Operands,
MCInst &Inst,
unsigned &ErrorInfo, bool matchingInlineAsm,
unsigned VariantID = 0);
enum OperandMatchResultTy {
MatchOperand_Success, // operand matched successfully
MatchOperand_NoMatch, // operand did not match
MatchOperand_ParseFail // operand matched but had errors
};
OperandMatchResultTy MatchOperandParserImpl(
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
StringRef Mnemonic);
OperandMatchResultTy tryCustomParseOperand(
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
unsigned MCK);
#endif // GET_ASSEMBLER_HEADER_INFO
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20130205/2c609aac/attachment.html>
Jonathan <gamma_chen at yahoo.com.tw> wrote:> I try to create a backend to support AsmParser, but it hasn't the redpart> as below. I find the Mips has this. Do you know how to make it appear? > > Jonathan > > #ifdef GET_ASSEMBLER_HEADER > #undef GET_ASSEMBLER_HEADER > // This should be included into the middle of the declaration of > // your subclasses implementation of MCTargetAsmParser. > unsigned ComputeAvailableFeatures(uint64_t FeatureBits) const; > void convertToMCInst(unsigned Kind, MCInst &Inst, unsigned Opcode, > const SmallVectorImpl<MCParsedAsmOperand*>&Operands);> void convertToMapAndConstraints(unsigned Kind, > const > SmallVectorImpl<MCParsedAsmOperand*> &Operands); > bool mnemonicIsValid(StringRef Mnemonic); > unsigned MatchInstructionImpl( > const > SmallVectorImpl<MCParsedAsmOperand*> &Operands, > MCInst &Inst, > unsigned &ErrorInfo, boolmatchingInlineAsm,> unsigned VariantID = 0); > > enum OperandMatchResultTy { > MatchOperand_Success, // operand matched successfully > MatchOperand_NoMatch, // operand did not match > MatchOperand_ParseFail // operand matched but had errors > }; > OperandMatchResultTy MatchOperandParserImpl( > SmallVectorImpl<MCParsedAsmOperand*> &Operands, > StringRef Mnemonic); > OperandMatchResultTy tryCustomParseOperand( > SmallVectorImpl<MCParsedAsmOperand*> &Operands, > unsigned MCK); > > #endif // GET_ASSEMBLER_HEADER_INFOMy understanding is that this will be generated automatically if any instruction has an operand that needs a custom parser (i.e. one that has been defined using the ParserMethod attribute). Bye, Ulrich
Ulrich, Very thank your help, it's OK now. I add the ParserMethod and ParserMatchClass and it work. Jonathan On 2013/2/5, at 下午10:20, Ulrich Weigand <Ulrich.Weigand at de.ibm.com> wrote:> Jonathan <gamma_chen at yahoo.com.tw> wrote: > >> I try to create a backend to support AsmParser, but it hasn't the red > part >> as below. I find the Mips has this. Do you know how to make it appear? >> >> Jonathan >> >> #ifdef GET_ASSEMBLER_HEADER >> #undef GET_ASSEMBLER_HEADER >> // This should be included into the middle of the declaration of >> // your subclasses implementation of MCTargetAsmParser. >> unsigned ComputeAvailableFeatures(uint64_t FeatureBits) const; >> void convertToMCInst(unsigned Kind, MCInst &Inst, unsigned Opcode, >> const SmallVectorImpl<MCParsedAsmOperand*> > &Operands); >> void convertToMapAndConstraints(unsigned Kind, >> const >> SmallVectorImpl<MCParsedAsmOperand*> &Operands); >> bool mnemonicIsValid(StringRef Mnemonic); >> unsigned MatchInstructionImpl( >> const >> SmallVectorImpl<MCParsedAsmOperand*> &Operands, >> MCInst &Inst, >> unsigned &ErrorInfo, bool > matchingInlineAsm, >> unsigned VariantID = 0); >> >> enum OperandMatchResultTy { >> MatchOperand_Success, // operand matched successfully >> MatchOperand_NoMatch, // operand did not match >> MatchOperand_ParseFail // operand matched but had errors >> }; >> OperandMatchResultTy MatchOperandParserImpl( >> SmallVectorImpl<MCParsedAsmOperand*> &Operands, >> StringRef Mnemonic); >> OperandMatchResultTy tryCustomParseOperand( >> SmallVectorImpl<MCParsedAsmOperand*> &Operands, >> unsigned MCK); >> >> #endif // GET_ASSEMBLER_HEADER_INFO > > My understanding is that this will be generated automatically > if any instruction has an operand that needs a custom parser > (i.e. one that has been defined using the ParserMethod attribute). > > Bye, > Ulrich >