LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
llvm::MCAsmParser Class Referenceabstract

#include <MCAsmParser.h>

Public Types

typedef bool(* DirectiveHandler )(MCAsmParserExtension *, StringRef, SMLoc)
 
typedef std::pair
< MCAsmParserExtension
*, DirectiveHandler
ExtensionDirectiveHandler
 

Public Member Functions

virtual ~MCAsmParser ()
 
virtual void addDirectiveHandler (StringRef Directive, ExtensionDirectiveHandler Handler)=0
 
virtual SourceMgrgetSourceManager ()=0
 
virtual MCAsmLexergetLexer ()=0
 
virtual MCContextgetContext ()=0
 
virtual MCStreamergetStreamer ()=0
 getStreamer - Return the output streamer for the assembler. More...
 
MCTargetAsmParsergetTargetParser () const
 
void setTargetParser (MCTargetAsmParser &P)
 
virtual unsigned getAssemblerDialect ()
 
virtual void setAssemblerDialect (unsigned i)
 
bool getShowParsedOperands () const
 
void setShowParsedOperands (bool Value)
 
virtual bool Run (bool NoInitialTextSection, bool NoFinalize=false)=0
 Run - Run the parser on the input source buffer. More...
 
virtual void setParsingInlineAsm (bool V)=0
 
virtual bool isParsingInlineAsm ()=0
 
virtual bool parseMSInlineAsm (void *AsmLoc, std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs, SmallVectorImpl< std::pair< void *, bool > > &OpDecls, SmallVectorImpl< std::string > &Constraints, SmallVectorImpl< std::string > &Clobbers, const MCInstrInfo *MII, const MCInstPrinter *IP, MCAsmParserSemaCallback &SI)=0
 parseMSInlineAsm - Parse ms-style inline assembly. More...
 
virtual bool Warning (SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0
 
virtual bool Error (SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0
 
virtual const AsmTokenLex ()=0
 
const AsmTokengetTok ()
 getTok - Get the current AsmToken from the stream. More...
 
bool TokError (const Twine &Msg, ArrayRef< SMRange > Ranges=None)
 Report an error at the current lexer location. More...
 
virtual bool parseIdentifier (StringRef &Res)=0
 
virtual StringRef parseStringToEndOfStatement ()=0
 Parse up to the end of statement and return the contents from the current token until the end of the statement; the current token on exit will be either the EndOfStatement or EOF. More...
 
virtual bool parseEscapedString (std::string &Data)=0
 
virtual void eatToEndOfStatement ()=0
 
virtual bool parseExpression (const MCExpr *&Res, SMLoc &EndLoc)=0
 
bool parseExpression (const MCExpr *&Res)
 
virtual bool parsePrimaryExpr (const MCExpr *&Res, SMLoc &EndLoc)=0
 
virtual bool parseParenExpression (const MCExpr *&Res, SMLoc &EndLoc)=0
 
virtual bool parseAbsoluteExpression (int64_t &Res)=0
 
virtual void checkForValidSection ()=0
 

Protected Member Functions

 MCAsmParser ()
 

Detailed Description

MCAsmParser - Generic assembler parser interface, for use by target specific assembly parsers.

Definition at line 64 of file MCAsmParser.h.

Member Typedef Documentation

typedef bool(* llvm::MCAsmParser::DirectiveHandler)(MCAsmParserExtension *, StringRef, SMLoc)

Definition at line 66 of file MCAsmParser.h.

Definition at line 68 of file MCAsmParser.h.

Constructor & Destructor Documentation

MCAsmParser::MCAsmParser ( )
protected

Definition at line 20 of file MCAsmParser.cpp.

MCAsmParser::~MCAsmParser ( )
virtual

Definition at line 23 of file MCAsmParser.cpp.

Member Function Documentation

virtual void llvm::MCAsmParser::addDirectiveHandler ( StringRef  Directive,
ExtensionDirectiveHandler  Handler 
)
pure virtual
virtual void llvm::MCAsmParser::checkForValidSection ( )
pure virtual

checkForValidSection - Ensure that we have a valid section set in the streamer. Otherwise, report an error and switch to .text.

virtual void llvm::MCAsmParser::eatToEndOfStatement ( )
pure virtual

eatToEndOfStatement - Skip to the end of the current statement, for error recovery.

virtual bool llvm::MCAsmParser::Error ( SMLoc  L,
const Twine Msg,
ArrayRef< SMRange Ranges = None 
)
pure virtual

Error - Emit an error at the location L, with the message Msg.

Returns
The return value is always true, as an idiomatic convenience to clients.

Referenced by llvm::MCAsmParserExtension::Error(), and TokError().

virtual unsigned llvm::MCAsmParser::getAssemblerDialect ( )
inlinevirtual

Definition at line 99 of file MCAsmParser.h.

virtual MCContext& llvm::MCAsmParser::getContext ( )
pure virtual
virtual MCAsmLexer& llvm::MCAsmParser::getLexer ( )
pure virtual
bool llvm::MCAsmParser::getShowParsedOperands ( ) const
inline

Definition at line 102 of file MCAsmParser.h.

virtual SourceMgr& llvm::MCAsmParser::getSourceManager ( )
pure virtual
virtual MCStreamer& llvm::MCAsmParser::getStreamer ( )
pure virtual

getStreamer - Return the output streamer for the assembler.

Referenced by llvm::MCAsmParserExtension::getStreamer().

MCTargetAsmParser& llvm::MCAsmParser::getTargetParser ( ) const
inline

Definition at line 96 of file MCAsmParser.h.

const AsmToken & MCAsmParser::getTok ( )

getTok - Get the current AsmToken from the stream.

Definition at line 32 of file MCAsmParser.cpp.

References getLexer(), and llvm::MCAsmLexer::getTok().

Referenced by llvm::MCAsmParserExtension::getTok().

virtual bool llvm::MCAsmParser::isParsingInlineAsm ( )
pure virtual
virtual const AsmToken& llvm::MCAsmParser::Lex ( )
pure virtual

Lex - Get the next AsmToken in the stream, possibly handling file inclusion first.

Referenced by llvm::MCAsmParserExtension::Lex().

virtual bool llvm::MCAsmParser::parseAbsoluteExpression ( int64_t &  Res)
pure virtual

parseAbsoluteExpression - Parse an expression which must evaluate to an absolute value.

Parameters
Res- The value of the absolute expression. The result is undefined on error.
Returns
- False on success.
virtual bool llvm::MCAsmParser::parseEscapedString ( std::string &  Data)
pure virtual

parseEscapedString - Parse the current token as a string which may include escaped characters and return the string contents.

virtual bool llvm::MCAsmParser::parseExpression ( const MCExpr *&  Res,
SMLoc EndLoc 
)
pure virtual

parseExpression - Parse an arbitrary expression.

Parameters
Res- The value of the expression. The result is undefined on error.
Returns
- False on success.

Referenced by parseExpression().

bool MCAsmParser::parseExpression ( const MCExpr *&  Res)

Definition at line 41 of file MCAsmParser.cpp.

References parseExpression().

virtual bool llvm::MCAsmParser::parseIdentifier ( StringRef Res)
pure virtual

parseIdentifier - Parse an identifier or string (as a quoted identifier) and set Res to the identifier contents.

virtual bool llvm::MCAsmParser::parseMSInlineAsm ( void *  AsmLoc,
std::string &  AsmString,
unsigned NumOutputs,
unsigned NumInputs,
SmallVectorImpl< std::pair< void *, bool > > &  OpDecls,
SmallVectorImpl< std::string > &  Constraints,
SmallVectorImpl< std::string > &  Clobbers,
const MCInstrInfo MII,
const MCInstPrinter IP,
MCAsmParserSemaCallback SI 
)
pure virtual

parseMSInlineAsm - Parse ms-style inline assembly.

virtual bool llvm::MCAsmParser::parseParenExpression ( const MCExpr *&  Res,
SMLoc EndLoc 
)
pure virtual

parseParenExpression - Parse an arbitrary expression, assuming that an initial '(' has already been consumed.

Parameters
Res- The value of the expression. The result is undefined on error.
Returns
- False on success.
virtual bool llvm::MCAsmParser::parsePrimaryExpr ( const MCExpr *&  Res,
SMLoc EndLoc 
)
pure virtual

parsePrimaryExpr - Parse a primary expression.

Parameters
Res- The value of the expression. The result is undefined on error.
Returns
- False on success.
virtual StringRef llvm::MCAsmParser::parseStringToEndOfStatement ( )
pure virtual

Parse up to the end of statement and return the contents from the current token until the end of the statement; the current token on exit will be either the EndOfStatement or EOF.

virtual bool llvm::MCAsmParser::Run ( bool  NoInitialTextSection,
bool  NoFinalize = false 
)
pure virtual

Run - Run the parser on the input source buffer.

virtual void llvm::MCAsmParser::setAssemblerDialect ( unsigned  i)
inlinevirtual

Definition at line 100 of file MCAsmParser.h.

virtual void llvm::MCAsmParser::setParsingInlineAsm ( bool  V)
pure virtual
void llvm::MCAsmParser::setShowParsedOperands ( bool  Value)
inline

Definition at line 103 of file MCAsmParser.h.

void MCAsmParser::setTargetParser ( MCTargetAsmParser P)

Definition at line 26 of file MCAsmParser.cpp.

References llvm::MCAsmParserExtension::Initialize(), and P.

bool MCAsmParser::TokError ( const Twine Msg,
ArrayRef< SMRange Ranges = None 
)

Report an error at the current lexer location.

Definition at line 36 of file MCAsmParser.cpp.

References Error(), and getLexer().

Referenced by llvm::MCAsmParserExtension::TokError().

virtual bool llvm::MCAsmParser::Warning ( SMLoc  L,
const Twine Msg,
ArrayRef< SMRange Ranges = None 
)
pure virtual

Warning - Emit a warning at the location L, with the message Msg.

Returns
The return value is true, if warnings are fatal.

Referenced by llvm::MCAsmParserExtension::Warning().


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