10 #ifndef LLVM_MC_MCEXPR_H
11 #define LLVM_MC_MCEXPR_H
15 #include "llvm/Support/DataTypes.h"
48 void operator=(
const MCExpr&) =
delete;
77 bool InParens =
false)
const;
91 bool evaluateAsAbsolute(int64_t &Res,
const MCAsmLayout &Layout,
93 bool evaluateAsAbsolute(int64_t &Res)
const;
94 bool evaluateAsAbsolute(int64_t &Res,
const MCAssembler &
Asm)
const;
95 bool evaluateAsAbsolute(int64_t &Res,
const MCAsmLayout &Layout)
const;
126 E.
print(OS,
nullptr);
283 const unsigned UseParensForSymbolVariant : 1;
286 const unsigned HasSubsectionsViaSymbols : 1;
355 static const MCUnaryExpr *
create(
Opcode Op,
const MCExpr *Expr,
427 static const MCBinaryExpr *
create(
Opcode Op,
const MCExpr *LHS,
428 const MCExpr *RHS, MCContext &Ctx);
532 virtual void anchor();
540 const MCFixup *Fixup)
const = 0;
bool evaluateKnownAbsolute(int64_t &Res, const MCAsmLayout &Layout) const
static const MCBinaryExpr * createGT(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
Signed less than comparison (result is either 0 or some target-specific non-zero value).
static const MCUnaryExpr * create(Opcode Op, const MCExpr *Expr, MCContext &Ctx)
static const MCUnaryExpr * createMinus(const MCExpr *Expr, MCContext &Ctx)
static const MCBinaryExpr * createEQ(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
const MCSymbol & getSymbol() const
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Signed less than or equal comparison (result is either 0 or some target-specific non-zero value)...
This represents an "assembler immediate".
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
static VariantKind getVariantKindForName(StringRef Name)
static const MCBinaryExpr * createAnd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createMul(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
void printVariantKind(raw_ostream &OS) const
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
static const MCBinaryExpr * create(Opcode Op, const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createXor(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
virtual void visitUsedExpr(MCStreamer &Streamer) const =0
Encapsulates the layout of an assembly file at a particular point in time.
static const MCBinaryExpr * createDiv(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Base class for the full range of assembler expressions which are needed for parsing.
This is an extension point for target-specific MCExpr subclasses to implement.
Represent a reference to a symbol from inside an expression.
virtual MCFragment * findAssociatedFragment() const =0
static const MCBinaryExpr * createAShr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Context object for machine code objects.
static const MCBinaryExpr * createShl(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createLOr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static bool classof(const MCExpr *E)
Unary assembler expressions.
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCUnaryExpr * createLNot(const MCExpr *Expr, MCContext &Ctx)
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
This class is intended to be used as a base class for asm properties and features specific to the tar...
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
Streaming machine code generation interface.
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm, const MCAsmLayout *Layout, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) const
bool evaluateAsValue(MCValue &Res, const MCAsmLayout &Layout) const
Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables...
static const MCBinaryExpr * createOr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
DenseMap< const MCSection *, uint64_t > SectionAddrMap
virtual bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const =0
Binary assembler expressions.
static const MCBinaryExpr * createLShr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
virtual void fixELFSymbolsInTLSFixups(MCAssembler &) const =0
static bool classof(const MCExpr *E)
static const MCBinaryExpr * createLT(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static bool classof(const MCExpr *E)
bool hasSubsectionsViaSymbols() const
Signed greater than comparison (result is either 0 or some target-specific non-zero value) ...
static const MCUnaryExpr * createPlus(const MCExpr *Expr, MCContext &Ctx)
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
Signed greater than or equal comparison (result is either 0 or some target-specific non-zero value)...
Target - Wrapper for Target specific information.
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
static const MCBinaryExpr * createLAnd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createNE(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
const MCExpr * getSubExpr() const
Get the child of this unary expression.
virtual void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const =0
static const MCBinaryExpr * createLTE(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Opcode getOpcode() const
Get the kind of this binary expression.
static const MCBinaryExpr * createMod(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
References to labels and assigned expressions.
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
static bool classof(const MCExpr *E)
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
VariantKind getKind() const
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
static const MCUnaryExpr * createNot(const MCExpr *Expr, MCContext &Ctx)
StringRef - Represent a constant reference to a string, i.e.
Target specific expression.
static bool classof(const MCExpr *E)
static const MCBinaryExpr * createGTE(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static StringRef getVariantKindName(VariantKind Kind)
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
Opcode getOpcode() const
Get the kind of this unary expression.