LLVM 20.0.0git
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
llvm::MCAsmParserExtension Class Reference

Generic interface for extending the MCAsmParser, which is implemented by target and object file assembly parser implementations. More...

#include "llvm/MC/MCParser/MCAsmParserExtension.h"

Inheritance diagram for llvm::MCAsmParserExtension:
Inheritance graph
[legend]

Public Member Functions

 MCAsmParserExtension (const MCAsmParserExtension &)=delete
 
MCAsmParserExtensionoperator= (const MCAsmParserExtension &)=delete
 
virtual ~MCAsmParserExtension ()
 
virtual void Initialize (MCAsmParser &Parser)
 Initialize the extension for parsing using the given Parser.
 
MCAsmParser Proxy Interfaces
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, SMRange Range=SMRange())
 
void Note (SMLoc L, const Twine &Msg)
 
bool TokError (const Twine &Msg)
 
const AsmTokenLex ()
 
const AsmTokengetTok ()
 
bool parseToken (AsmToken::TokenKind T, const Twine &Msg="unexpected token")
 
bool parseEOL ()
 
bool parseMany (function_ref< bool()> parseOne, bool hasComma=true)
 
bool parseOptionalToken (AsmToken::TokenKind T)
 
bool ParseDirectiveCGProfile (StringRef, SMLoc)
 ParseDirectiveCGProfile ::= .cg_profile identifier, identifier, <number>
 
bool check (bool P, const Twine &Msg)
 
bool check (bool P, SMLoc Loc, const Twine &Msg)
 
bool addErrorSuffix (const Twine &Suffix)
 
bool HasBracketExpressions () const
 

Protected Member Functions

 MCAsmParserExtension ()
 

Static Protected Member Functions

template<typename T , bool(T::*)(StringRef, SMLoc) Handler>
static bool HandleDirective (MCAsmParserExtension *Target, StringRef Directive, SMLoc DirectiveLoc)
 

Protected Attributes

bool BracketExpressionsSupported = false
 

Detailed Description

Generic interface for extending the MCAsmParser, which is implemented by target and object file assembly parser implementations.

Definition at line 24 of file MCAsmParserExtension.h.

Constructor & Destructor Documentation

◆ MCAsmParserExtension() [1/2]

MCAsmParserExtension::MCAsmParserExtension ( )
protecteddefault

◆ MCAsmParserExtension() [2/2]

llvm::MCAsmParserExtension::MCAsmParserExtension ( const MCAsmParserExtension )
delete

◆ ~MCAsmParserExtension()

MCAsmParserExtension::~MCAsmParserExtension ( )
virtualdefault

Member Function Documentation

◆ addErrorSuffix()

bool llvm::MCAsmParserExtension::addErrorSuffix ( const Twine Suffix)
inline

Definition at line 111 of file MCAsmParserExtension.h.

References llvm::MCAsmParser::addErrorSuffix(), and getParser().

◆ check() [1/2]

bool llvm::MCAsmParserExtension::check ( bool  P,
const Twine Msg 
)
inline

Definition at line 103 of file MCAsmParserExtension.h.

References llvm::MCAsmParser::check(), getParser(), and P.

◆ check() [2/2]

bool llvm::MCAsmParserExtension::check ( bool  P,
SMLoc  Loc,
const Twine Msg 
)
inline

Definition at line 107 of file MCAsmParserExtension.h.

References llvm::MCAsmParser::check(), getParser(), and P.

◆ Error()

bool llvm::MCAsmParserExtension::Error ( SMLoc  L,
const Twine Msg,
SMRange  Range = SMRange() 
)
inline

Definition at line 73 of file MCAsmParserExtension.h.

References llvm::MCAsmParser::Error(), getParser(), and Range.

◆ getContext()

MCContext & llvm::MCAsmParserExtension::getContext ( )
inline

◆ getLexer() [1/2]

MCAsmLexer & llvm::MCAsmParserExtension::getLexer ( )
inline

Definition at line 56 of file MCAsmParserExtension.h.

References llvm::MCAsmParser::getLexer(), and getParser().

Referenced by getLexer(), and ParseDirectiveCGProfile().

◆ getLexer() [2/2]

const MCAsmLexer & llvm::MCAsmParserExtension::getLexer ( ) const
inline

Definition at line 57 of file MCAsmParserExtension.h.

References getLexer().

◆ getParser() [1/2]

MCAsmParser & llvm::MCAsmParserExtension::getParser ( )
inline

◆ getParser() [2/2]

const MCAsmParser & llvm::MCAsmParserExtension::getParser ( ) const
inline

Definition at line 62 of file MCAsmParserExtension.h.

References getParser().

◆ getSourceManager()

SourceMgr & llvm::MCAsmParserExtension::getSourceManager ( )
inline

Definition at line 66 of file MCAsmParserExtension.h.

References getParser(), and llvm::MCAsmParser::getSourceManager().

◆ getStreamer()

MCStreamer & llvm::MCAsmParserExtension::getStreamer ( )
inline

Definition at line 67 of file MCAsmParserExtension.h.

References getParser(), and llvm::MCAsmParser::getStreamer().

Referenced by ParseDirectiveCGProfile().

◆ getTok()

const AsmToken & llvm::MCAsmParserExtension::getTok ( )
inline

◆ HandleDirective()

template<typename T , bool(T::*)(StringRef, SMLoc) Handler>
static bool llvm::MCAsmParserExtension::HandleDirective ( MCAsmParserExtension Target,
StringRef  Directive,
SMLoc  DirectiveLoc 
)
inlinestaticprotected

Definition at line 32 of file MCAsmParserExtension.h.

◆ HasBracketExpressions()

bool llvm::MCAsmParserExtension::HasBracketExpressions ( ) const
inline

Definition at line 115 of file MCAsmParserExtension.h.

References BracketExpressionsSupported.

◆ Initialize()

void MCAsmParserExtension::Initialize ( MCAsmParser Parser)
virtual

Initialize the extension for parsing using the given Parser.

The extension should use the AsmParser interfaces to register its parsing routines.

Definition at line 21 of file MCAsmParserExtension.cpp.

Referenced by llvm::MCAsmParser::setTargetParser().

◆ Lex()

const AsmToken & llvm::MCAsmParserExtension::Lex ( )
inline

Definition at line 85 of file MCAsmParserExtension.h.

References getParser(), and llvm::MCAsmParser::Lex().

Referenced by ParseDirectiveCGProfile().

◆ Note()

void llvm::MCAsmParserExtension::Note ( SMLoc  L,
const Twine Msg 
)
inline

Definition at line 77 of file MCAsmParserExtension.h.

References getParser(), and llvm::MCAsmParser::Note().

◆ operator=()

MCAsmParserExtension & llvm::MCAsmParserExtension::operator= ( const MCAsmParserExtension )
delete

◆ ParseDirectiveCGProfile()

bool MCAsmParserExtension::ParseDirectiveCGProfile ( StringRef  ,
SMLoc   
)

◆ parseEOL()

bool llvm::MCAsmParserExtension::parseEOL ( )
inline

Definition at line 91 of file MCAsmParserExtension.h.

References getParser(), and llvm::MCAsmParser::parseEOL().

◆ parseMany()

bool llvm::MCAsmParserExtension::parseMany ( function_ref< bool()>  parseOne,
bool  hasComma = true 
)
inline

Definition at line 93 of file MCAsmParserExtension.h.

References getParser(), and llvm::MCAsmParser::parseMany().

◆ parseOptionalToken()

bool llvm::MCAsmParserExtension::parseOptionalToken ( AsmToken::TokenKind  T)
inline

Definition at line 97 of file MCAsmParserExtension.h.

References getParser(), and llvm::MCAsmParser::parseOptionalToken().

◆ parseToken()

bool llvm::MCAsmParserExtension::parseToken ( AsmToken::TokenKind  T,
const Twine Msg = "unexpected token" 
)
inline

Definition at line 87 of file MCAsmParserExtension.h.

References getParser(), and llvm::MCAsmParser::parseToken().

◆ TokError()

bool llvm::MCAsmParserExtension::TokError ( const Twine Msg)
inline

Definition at line 81 of file MCAsmParserExtension.h.

References getParser(), and llvm::MCAsmParser::TokError().

Referenced by ParseDirectiveCGProfile().

◆ Warning()

bool llvm::MCAsmParserExtension::Warning ( SMLoc  L,
const Twine Msg 
)
inline

Definition at line 69 of file MCAsmParserExtension.h.

References getParser(), and llvm::MCAsmParser::Warning().

Member Data Documentation

◆ BracketExpressionsSupported

bool llvm::MCAsmParserExtension::BracketExpressionsSupported = false
protected

Definition at line 39 of file MCAsmParserExtension.h.

Referenced by HasBracketExpressions().


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