10 #ifndef LLVM_MC_MCEXPR_H 11 #define LLVM_MC_MCEXPR_H 81 bool InParens =
false)
const;
95 bool evaluateAsAbsolute(int64_t &Res,
const MCAsmLayout &Layout,
97 bool evaluateAsAbsolute(int64_t &Res)
const;
98 bool evaluateAsAbsolute(int64_t &Res,
const MCAssembler &Asm)
const;
99 bool evaluateAsAbsolute(int64_t &Res,
const MCAssembler *Asm)
const;
100 bool evaluateAsAbsolute(int64_t &Res,
const MCAsmLayout &Layout)
const;
131 E.
print(OS,
nullptr);
308 const unsigned UseParensForSymbolVariant : 1;
311 const unsigned HasSubsectionsViaSymbols : 1;
384 return create(LNot, Expr, Ctx, Loc);
388 return create(Minus, Expr, Ctx, Loc);
392 return create(Not, Expr, Ctx, Loc);
396 return create(Plus, Expr, Ctx, Loc);
463 return create(
Add, LHS, RHS, Ctx);
468 return create(And, LHS, RHS, Ctx);
473 return create(Div, LHS, RHS, Ctx);
478 return create(
EQ, LHS, RHS, Ctx);
483 return create(
GT, LHS, RHS, Ctx);
488 return create(GTE, LHS, RHS, Ctx);
493 return create(LAnd, LHS, RHS, Ctx);
498 return create(LOr, LHS, RHS, Ctx);
503 return create(
LT, LHS, RHS, Ctx);
508 return create(LTE, LHS, RHS, Ctx);
513 return create(
Mod, LHS, RHS, Ctx);
518 return create(Mul, LHS, RHS, Ctx);
523 return create(
NE, LHS, RHS, Ctx);
528 return create(Or, LHS, RHS, Ctx);
533 return create(Shl, LHS, RHS, Ctx);
538 return create(AShr, LHS, RHS, Ctx);
543 return create(LShr, LHS, RHS, Ctx);
548 return create(Sub, LHS, RHS, Ctx);
553 return create(Xor, LHS, RHS, Ctx);
582 virtual void anchor();
598 virtual void visitUsedExpr(
MCStreamer& Streamer)
const = 0;
601 virtual void fixELFSymbolsInTLSFixups(
MCAssembler &)
const = 0;
610 #endif // LLVM_MC_MCEXPR_H static const MCUnaryExpr * createLNot(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
static const MCBinaryExpr * createGT(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createEQ(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
This class represents lattice values for constants.
This represents an "assembler immediate".
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
VariantKind getKind() const
Opcode getOpcode() const
Get the kind of this unary expression.
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
static const MCBinaryExpr * createAnd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createMul(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
static const MCBinaryExpr * createXor(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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.
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)
virtual bool inlineAssignedExpr() const
static const MCBinaryExpr * createLOr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
static bool classof(const MCExpr *E)
Unary assembler expressions.
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
This class is intended to be used as a base class for asm properties and features specific to the tar...
static const MCUnaryExpr * createPlus(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
Streaming machine code generation interface.
bool evaluateKnownAbsolute(int64_t &Res, const MCAsmLayout &Layout) const
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static const MCBinaryExpr * createOr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Binary assembler expressions.
bool hasSubsectionsViaSymbols() const
static const MCBinaryExpr * createLShr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCUnaryExpr * createMinus(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
PowerPC TLS Dynamic Call Fixup
static bool classof(const MCExpr *E)
const MCSymbol & getSymbol() const
static const MCBinaryExpr * createLT(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static bool classof(const MCExpr *E)
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm, const MCAsmLayout *Layout, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) const
MCExpr & operator=(const MCExpr &)=delete
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
The access may modify the value stored in memory.
Target - Wrapper for Target specific information.
static const MCBinaryExpr * createLAnd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createNE(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createLTE(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCUnaryExpr * createNot(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc=SMLoc())
static const MCBinaryExpr * createMod(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
References to labels and assigned expressions.
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...
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
virtual bool isEqualTo(const MCExpr *x) const
static bool classof(const MCExpr *E)
Opcode getOpcode() const
Get the kind of this binary expression.
const MCExpr * getSubExpr() const
Get the child of this unary expression.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
Target specific expression.
static bool classof(const MCExpr *E)
Represents a location in source code.
MCExpr(ExprKind Kind, SMLoc Loc)
static const MCBinaryExpr * createGTE(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)