27 #define DEBUG_TYPE "riscvmcexpr" 59 for (
const MCFixup &
F : DF->getFixups()) {
63 switch ((
unsigned)
F.getKind()) {
115 uint64_t AUIPCOffset = AUIPCSymbol->
getOffset();
192 int64_t RISCVMCExpr::evaluateAsInt64(int64_t
Value)
const {
197 return SignExtend64<12>(Value);
200 return ((Value + 0x800) >> 12) & 0xfffff;
bool evaluateAsConstant(int64_t &Res) const
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 ...
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
VariantKind getKind() const
bool isAbsolute() const
Is this an absolute (as opposed to relocatable) value.
static StringRef getVariantKindName(VariantKind Kind)
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
int64_t getConstant() const
const MCSymbolRefExpr * getSymB() const
Encapsulates the layout of an assembly file at a particular point in time.
Base class for the full range of assembler expressions which are needed for parsing.
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute)...
Represent a reference to a symbol from inside an expression.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
Context object for machine code objects.
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
const MCFixup * getPCRelHiFixup() const
Get the MCExpr of the VK_RISCV_PCREL_HI Fixup that the VK_RISCV_PCREL_LO points to.
const MCExpr * getSubExpr() const
This class is intended to be used as a base class for asm properties and features specific to the tar...
A switch()-like statement whose cases are string literals.
Streaming machine code generation interface.
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
const MCSymbolRefExpr * getSymA() const
uint64_t getOffset() const
uint32_t getOffset() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
PowerPC TLS Dynamic Call Fixup
const MCSymbol & getSymbol() const
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
MCFragment * findAssociatedFragment() const override
void visitUsedExpr(const MCExpr &Expr)
MCSection * getParent() const
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override
static VariantKind getVariantKindForName(StringRef name)
static MCValue get(const MCSymbolRefExpr *SymA, const MCSymbolRefExpr *SymB=nullptr, int64_t Val=0, uint32_t RefKind=0)
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...
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
const MCExpr * getValue() const
StringRef - Represent a constant reference to a string, i.e.
Target specific expression.
void visitUsedExpr(MCStreamer &Streamer) const override
static const RISCVMCExpr * create(const MCExpr *Expr, VariantKind Kind, MCContext &Ctx)
MCFixupKind getKind() const