mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
add a helper method for creating MCSymbol and MCSymbolRefExpr at
the same time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81984 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,6 +19,7 @@ class MCContext;
|
|||||||
class MCSymbol;
|
class MCSymbol;
|
||||||
class MCValue;
|
class MCValue;
|
||||||
class raw_ostream;
|
class raw_ostream;
|
||||||
|
class StringRef;
|
||||||
|
|
||||||
/// MCExpr - Base class for the full range of assembler expressions which are
|
/// MCExpr - Base class for the full range of assembler expressions which are
|
||||||
/// needed for parsing.
|
/// needed for parsing.
|
||||||
@@ -119,7 +120,10 @@ public:
|
|||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
static const MCSymbolRefExpr *Create(const MCSymbol *Symbol, MCContext &Ctx);
|
static const MCSymbolRefExpr *Create(const MCSymbol *Symbol, MCContext &Ctx);
|
||||||
|
static const MCSymbolRefExpr *Create(const StringRef &Name, MCContext &Ctx);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Accessors
|
/// @name Accessors
|
||||||
/// @{
|
/// @{
|
||||||
|
@@ -133,6 +133,12 @@ const MCSymbolRefExpr *MCSymbolRefExpr::Create(const MCSymbol *Sym,
|
|||||||
return new (Ctx) MCSymbolRefExpr(Sym);
|
return new (Ctx) MCSymbolRefExpr(Sym);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MCSymbolRefExpr *MCSymbolRefExpr::Create(const StringRef &Name,
|
||||||
|
MCContext &Ctx) {
|
||||||
|
return Create(Ctx.GetOrCreateSymbol(Name), Ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* *** */
|
/* *** */
|
||||||
|
|
||||||
bool MCExpr::EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const {
|
bool MCExpr::EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const {
|
||||||
|
Reference in New Issue
Block a user