LLVM  3.7.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::MCTargetAsmParser Class Referenceabstract

MCTargetAsmParser - Generic interface to target specific assembly parsers. More...

#include <MCTargetAsmParser.h>

Inheritance diagram for llvm::MCTargetAsmParser:
[legend]
Collaboration diagram for llvm::MCTargetAsmParser:
[legend]

Public Types

enum  MatchResultTy {
  Match_InvalidOperand, Match_MissingFeature, Match_MnemonicFail, Match_Success,
  FIRST_TARGET_MATCH_RESULT_TY
}
 

Public Member Functions

 ~MCTargetAsmParser () override
 
uint64_t getAvailableFeatures () const
 
void setAvailableFeatures (uint64_t Value)
 
bool isParsingInlineAsm ()
 
void setParsingInlineAsm (bool Value)
 
MCTargetOptions getTargetOptions () const
 
void setSemaCallback (MCAsmParserSemaCallback *Callback)
 
virtual bool ParseRegister (unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc)=0
 
virtual void SetFrameRegister (unsigned RegNo)
 Sets frame register corresponding to the current MachineFunction. More...
 
virtual bool ParseInstruction (ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc, OperandVector &Operands)=0
 ParseInstruction - Parse one assembly instruction. More...
 
virtual bool ParseDirective (AsmToken DirectiveID)=0
 ParseDirective - Parse a target specific assembler directive. More...
 
virtual bool mnemonicIsValid (StringRef Mnemonic, unsigned VariantID)=0
 mnemonicIsValid - This returns true if this is a valid mnemonic and false otherwise. More...
 
virtual bool MatchAndEmitInstruction (SMLoc IDLoc, unsigned &Opcode, OperandVector &Operands, MCStreamer &Out, uint64_t &ErrorInfo, bool MatchingInlineAsm)=0
 MatchAndEmitInstruction - Recognize a series of operands of a parsed instruction as an actual MCInst and emit it to the specified MCStreamer. More...
 
virtual bool OmitRegisterFromClobberLists (unsigned RegNo)
 Allows targets to let registers opt out of clobber lists. More...
 
virtual unsigned validateTargetOperandClass (MCParsedAsmOperand &Op, unsigned Kind)
 Allow a target to add special case operand matching for things that tblgen doesn't/can't handle effectively. More...
 
virtual unsigned checkTargetMatchPredicate (MCInst &Inst)
 checkTargetMatchPredicate - Validate the instruction match against any complex target predicates not expressible via match classes. More...
 
virtual void convertToMapAndConstraints (unsigned Kind, const OperandVector &Operands)=0
 
virtual const MCExprapplyModifierToExpr (const MCExpr *E, MCSymbolRefExpr::VariantKind, MCContext &Ctx)
 
virtual void onLabelParsed (MCSymbol *Symbol)
 
- Public Member Functions inherited from llvm::MCAsmParserExtension
virtual ~MCAsmParserExtension ()
 
virtual void Initialize (MCAsmParser &Parser)
 Initialize the extension for parsing using the given Parser. More...
 
MCContextgetContext ()
 
MCAsmLexergetLexer ()
 
const MCAsmLexergetLexer () const
 
MCAsmParsergetParser ()
 
const MCAsmParsergetParser () const
 
SourceMgrgetSourceManager ()
 
MCStreamergetStreamer ()
 
bool Warning (SMLoc L, const Twine &Msg)
 
bool Error (SMLoc L, const Twine &Msg)
 
bool TokError (const Twine &Msg)
 
const AsmTokenLex ()
 
const AsmTokengetTok ()
 
bool HasBracketExpressions () const
 

Protected Member Functions

 MCTargetAsmParser ()
 
- Protected Member Functions inherited from llvm::MCAsmParserExtension
 MCAsmParserExtension ()
 

Protected Attributes

uint64_t AvailableFeatures
 AvailableFeatures - The current set of available features. More...
 
bool ParsingInlineAsm
 ParsingInlineAsm - Are we parsing ms-style inline assembly? More...
 
MCAsmParserSemaCallbackSemaCallback
 SemaCallback - The Sema callback implementation. More...
 
MCTargetOptions MCOptions
 Set of options which affects instrumentation of inline assembly. More...
 
- Protected Attributes inherited from llvm::MCAsmParserExtension
bool BracketExpressionsSupported
 

Additional Inherited Members

- Static Protected Member Functions inherited from llvm::MCAsmParserExtension
template<typename T , bool(T::*)(StringRef, SMLoc) Handler>
static bool HandleDirective (MCAsmParserExtension *Target, StringRef Directive, SMLoc DirectiveLoc)
 

Detailed Description

MCTargetAsmParser - Generic interface to target specific assembly parsers.

Definition at line 81 of file MCTargetAsmParser.h.

Member Enumeration Documentation

Enumerator
Match_InvalidOperand 
Match_MissingFeature 
Match_MnemonicFail 
Match_Success 
FIRST_TARGET_MATCH_RESULT_TY 

Definition at line 83 of file MCTargetAsmParser.h.

Constructor & Destructor Documentation

MCTargetAsmParser::MCTargetAsmParser ( )
protected

Definition at line 13 of file MCTargetAsmParser.cpp.

MCTargetAsmParser::~MCTargetAsmParser ( )
override

Definition at line 18 of file MCTargetAsmParser.cpp.

Member Function Documentation

virtual const MCExpr* llvm::MCTargetAsmParser::applyModifierToExpr ( const MCExpr E,
MCSymbolRefExpr::VariantKind  ,
MCContext Ctx 
)
inlinevirtual

Definition at line 195 of file MCTargetAsmParser.h.

virtual unsigned llvm::MCTargetAsmParser::checkTargetMatchPredicate ( MCInst Inst)
inlinevirtual

checkTargetMatchPredicate - Validate the instruction match against any complex target predicates not expressible via match classes.

Definition at line 188 of file MCTargetAsmParser.h.

References Match_Success.

virtual void llvm::MCTargetAsmParser::convertToMapAndConstraints ( unsigned  Kind,
const OperandVector Operands 
)
pure virtual
uint64_t llvm::MCTargetAsmParser::getAvailableFeatures ( ) const
inline

Definition at line 113 of file MCTargetAsmParser.h.

References AvailableFeatures.

MCTargetOptions llvm::MCTargetAsmParser::getTargetOptions ( ) const
inline

Definition at line 119 of file MCTargetAsmParser.h.

References MCOptions.

bool llvm::MCTargetAsmParser::isParsingInlineAsm ( )
inline

Definition at line 116 of file MCTargetAsmParser.h.

References ParsingInlineAsm.

virtual bool llvm::MCTargetAsmParser::MatchAndEmitInstruction ( SMLoc  IDLoc,
unsigned Opcode,
OperandVector Operands,
MCStreamer Out,
uint64_t &  ErrorInfo,
bool  MatchingInlineAsm 
)
pure virtual

MatchAndEmitInstruction - Recognize a series of operands of a parsed instruction as an actual MCInst and emit it to the specified MCStreamer.

This returns false on success and returns true on failure to match.

On failure, the target parser is responsible for emitting a diagnostic explaining the match failure.

virtual bool llvm::MCTargetAsmParser::mnemonicIsValid ( StringRef  Mnemonic,
unsigned  VariantID 
)
pure virtual

mnemonicIsValid - This returns true if this is a valid mnemonic and false otherwise.

virtual bool llvm::MCTargetAsmParser::OmitRegisterFromClobberLists ( unsigned  RegNo)
inlinevirtual

Allows targets to let registers opt out of clobber lists.

Definition at line 175 of file MCTargetAsmParser.h.

virtual void llvm::MCTargetAsmParser::onLabelParsed ( MCSymbol Symbol)
inlinevirtual

Definition at line 201 of file MCTargetAsmParser.h.

virtual bool llvm::MCTargetAsmParser::ParseDirective ( AsmToken  DirectiveID)
pure virtual

ParseDirective - Parse a target specific assembler directive.

The parser is positioned following the directive name. The target specific directive parser should parse the entire directive doing or recording any target specific work, or return true and do nothing if the directive is not target specific. If the directive is specific for the target, the entire line is parsed up to and including the end-of-statement token and false is returned.

Parameters
DirectiveID- the identifier token of the directive.
virtual bool llvm::MCTargetAsmParser::ParseInstruction ( ParseInstructionInfo Info,
StringRef  Name,
SMLoc  NameLoc,
OperandVector Operands 
)
pure virtual

ParseInstruction - Parse one assembly instruction.

The parser is positioned following the instruction name. The target specific instruction parser should parse the entire instruction and construct the appropriate MCInst, or emit an error. On success, the entire line should be parsed up to and including the end-of-statement token. On failure, the parser is not required to read to the end of the line.

Parameters
Name- The instruction name.
NameLoc- The source location of the name.
Operands[out] - The list of parsed operands, this returns ownership of them to the caller.
Returns
True on failure.
virtual bool llvm::MCTargetAsmParser::ParseRegister ( unsigned RegNo,
SMLoc StartLoc,
SMLoc EndLoc 
)
pure virtual
void llvm::MCTargetAsmParser::setAvailableFeatures ( uint64_t  Value)
inline

Definition at line 114 of file MCTargetAsmParser.h.

References AvailableFeatures.

virtual void llvm::MCTargetAsmParser::SetFrameRegister ( unsigned  RegNo)
inlinevirtual

Sets frame register corresponding to the current MachineFunction.

Definition at line 129 of file MCTargetAsmParser.h.

void llvm::MCTargetAsmParser::setParsingInlineAsm ( bool  Value)
inline

Definition at line 117 of file MCTargetAsmParser.h.

References ParsingInlineAsm.

void llvm::MCTargetAsmParser::setSemaCallback ( MCAsmParserSemaCallback Callback)
inline

Definition at line 121 of file MCTargetAsmParser.h.

References SemaCallback.

virtual unsigned llvm::MCTargetAsmParser::validateTargetOperandClass ( MCParsedAsmOperand Op,
unsigned  Kind 
)
inlinevirtual

Allow a target to add special case operand matching for things that tblgen doesn't/can't handle effectively.

For example, literal immediates on ARM. TableGen expects a token operand, but the parser will recognize them as immediates.

Definition at line 181 of file MCTargetAsmParser.h.

References Match_InvalidOperand.

Member Data Documentation

uint64_t llvm::MCTargetAsmParser::AvailableFeatures
protected

AvailableFeatures - The current set of available features.

Definition at line 98 of file MCTargetAsmParser.h.

Referenced by getAvailableFeatures(), and setAvailableFeatures().

MCTargetOptions llvm::MCTargetAsmParser::MCOptions
protected

Set of options which affects instrumentation of inline assembly.

Definition at line 108 of file MCTargetAsmParser.h.

Referenced by getTargetOptions().

bool llvm::MCTargetAsmParser::ParsingInlineAsm
protected

ParsingInlineAsm - Are we parsing ms-style inline assembly?

Definition at line 101 of file MCTargetAsmParser.h.

Referenced by isParsingInlineAsm(), and setParsingInlineAsm().

MCAsmParserSemaCallback* llvm::MCTargetAsmParser::SemaCallback
protected

SemaCallback - The Sema callback implementation.

Must be set when parsing ms-style inline assembly.

Definition at line 105 of file MCTargetAsmParser.h.

Referenced by setSemaCallback().


The documentation for this class was generated from the following files: