LLVM 22.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:
[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 ()
 
AsmLexergetLexer ()
 
const AsmLexergetLexer () 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 maybeParseUniqueID (int64_t &UniqueID)
 
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 25 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 114 of file MCAsmParserExtension.h.

◆ check() [1/2]

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

Definition at line 106 of file MCAsmParserExtension.h.

References P.

◆ check() [2/2]

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

Definition at line 110 of file MCAsmParserExtension.h.

References P.

◆ Error()

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

Definition at line 74 of file MCAsmParserExtension.h.

References Range.

◆ getContext()

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

◆ getLexer() [1/2]

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

Definition at line 57 of file MCAsmParserExtension.h.

Referenced by maybeParseUniqueID(), and parseDirectiveCGProfile().

◆ getLexer() [2/2]

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

Definition at line 58 of file MCAsmParserExtension.h.

◆ getParser() [1/2]

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

◆ getParser() [2/2]

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

Definition at line 63 of file MCAsmParserExtension.h.

◆ getSourceManager()

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

Definition at line 67 of file MCAsmParserExtension.h.

◆ getStreamer()

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

◆ getTok()

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

Definition at line 87 of file MCAsmParserExtension.h.

Referenced by llvm::MCTargetAsmParser::parseDirective().

◆ HandleDirective()

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

Definition at line 33 of file MCAsmParserExtension.h.

◆ HasBracketExpressions()

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

Definition at line 118 of file MCAsmParserExtension.h.

◆ 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 86 of file MCAsmParserExtension.h.

Referenced by maybeParseUniqueID(), and parseDirectiveCGProfile().

◆ maybeParseUniqueID()

bool MCAsmParserExtension::maybeParseUniqueID ( int64_t &  UniqueID)

Definition at line 62 of file MCAsmParserExtension.cpp.

References llvm::AsmToken::Comma, getLexer(), getParser(), Lex(), and TokError().

◆ Note()

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

Definition at line 78 of file MCAsmParserExtension.h.

◆ operator=()

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

◆ parseDirectiveCGProfile()

bool MCAsmParserExtension::parseDirectiveCGProfile ( StringRef  ,
SMLoc   
)

◆ parseEOL()

bool llvm::MCAsmParserExtension::parseEOL ( )
inline

Definition at line 92 of file MCAsmParserExtension.h.

◆ parseMany()

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

Definition at line 94 of file MCAsmParserExtension.h.

◆ parseOptionalToken()

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

Definition at line 98 of file MCAsmParserExtension.h.

◆ parseToken()

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

Definition at line 88 of file MCAsmParserExtension.h.

◆ TokError()

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

Definition at line 82 of file MCAsmParserExtension.h.

Referenced by maybeParseUniqueID(), and parseDirectiveCGProfile().

◆ Warning()

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

Definition at line 70 of file MCAsmParserExtension.h.

Member Data Documentation

◆ BracketExpressionsSupported

bool llvm::MCAsmParserExtension::BracketExpressionsSupported = false
protected

Definition at line 40 of file MCAsmParserExtension.h.


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