LLVM 20.0.0git
|
Functions | |
bool | parseAssignmentExpression (StringRef Name, bool allow_redef, MCAsmParser &Parser, MCSymbol *&Symbol, const MCExpr *&Value) |
Parse a value expression and return whether it can be assigned to a symbol with the given name. | |
static bool | isSymbolUsedInExpression (const MCSymbol *Sym, const MCExpr *Value) |
Returns whether the given symbol is used anywhere in the given expression, or subexpressions. | |
|
static |
Returns whether the given symbol is used anywhere in the given expression, or subexpressions.
Definition at line 6381 of file AsmParser.cpp.
References llvm::MCExpr::Binary, llvm::MCExpr::Constant, llvm::MCBinaryExpr::getLHS(), llvm::MCBinaryExpr::getRHS(), llvm::MCSymbol::getVariableValue(), isSymbolUsedInExpression(), llvm::MCSymbol::isVariable(), llvm::MCSymbol::isWeakExternal(), llvm_unreachable, Sym, llvm::MCExpr::SymbolRef, llvm::MCExpr::Target, and llvm::MCExpr::Unary.
Referenced by isSymbolUsedInExpression(), and parseAssignmentExpression().
bool llvm::MCParserUtils::parseAssignmentExpression | ( | StringRef | Name, |
bool | allow_redef, | ||
MCAsmParser & | Parser, | ||
MCSymbol *& | Symbol, | ||
const MCExpr *& | Value | ||
) |
Parse a value expression and return whether it can be assigned to a symbol with the given name.
On success, returns false and sets the Symbol and Value output parameters.
Definition at line 6406 of file AsmParser.cpp.
References llvm::MCStreamer::emitValueToOffset(), llvm::MCAsmParser::Error(), llvm::MCAsmParser::getContext(), llvm::AsmToken::getLoc(), llvm::MCContext::getOrCreateSymbol(), llvm::MCAsmParser::getStreamer(), llvm::MCAsmParser::getTok(), isSymbolUsedInExpression(), llvm::MCContext::lookupSymbol(), Name, llvm::MCAsmParser::parseEOL(), llvm::MCAsmParser::parseExpression(), Sym, and llvm::MCAsmParser::TokError().