Go to the documentation of this file.
29 #define DEBUG_TYPE "riscvmcexpr"
60 const auto *
DF = dyn_cast_or_null<MCDataFragment>(AUIPCSymbol->
getFragment());
66 if (
DF->getContents().size() ==
Offset) {
67 DF = dyn_cast_or_null<MCDataFragment>(
DF->getNextNode());
77 switch ((
unsigned)
F.getKind()) {
141 return "got_pcrel_hi";
149 return "tls_ie_pcrel_hi";
151 return "tls_gd_pcrel_hi";
217 if (!
Value.isAbsolute())
220 Res = evaluateAsInt64(
Value.getConstant());
224 int64_t RISCVMCExpr::evaluateAsInt64(int64_t
Value)
const {
229 return SignExtend64<12>(
Value);
232 return ((
Value + 0x800) >> 12) & 0xfffff;
StringSwitch & Case(StringLiteral S, T Value)
void visitUsedExpr(const MCExpr &Expr)
This is an optimization pass for GlobalISel generic memory operations.
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
Context object for machine code objects.
uint64_t getOffset() const
This class is intended to be used as a base class for asm properties and features specific to the tar...
bool evaluateAsConstant(int64_t &Res) const
@ fixup_riscv_tls_gd_hi20
static void fixELFSymbolsInTLSFixupsImpl(const MCExpr *Expr, MCAssembler &Asm)
MCFragment * getFragment(bool SetUsed=true) const
static VariantKind getVariantKindForName(StringRef name)
Binary assembler expressions.
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
Streaming machine code generation interface.
@ fixup_riscv_tls_got_hi20
@ Target
Target specific expression.
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
This class implements an extremely fast bulk output stream that can only output to a stream.
const MCSymbol & getSymbol() const
int64_t getConstant() const
const MCSymbolRefExpr * getSymA() const
@ Binary
Binary expressions.
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
const MCExpr * getSubExpr() const
static const RISCVMCExpr * create(const MCExpr *Expr, VariantKind Kind, MCContext &Ctx)
static MCValue get(const MCSymbolRefExpr *SymA, const MCSymbolRefExpr *SymB=nullptr, int64_t Val=0, uint32_t RefKind=0)
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override
void visitUsedExpr(MCStreamer &Streamer) const override
Represent a reference to a symbol from inside an expression.
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override
VariantKind getKind() const
Encapsulates the layout of an assembly file at a particular point in time.
static StringRef getVariantKindName(VariantKind Kind)
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
@ SymbolRef
References to labels and assigned expressions.
@ Unary
Unary expressions.
@ Constant
Constant expressions.
A switch()-like statement whose cases are string literals.
const MCFixup * getPCRelHiFixup(const MCFragment **DFOut) const
Get the corresponding PC-relative HI fixup that a VK_RISCV_PCREL_LO points to, and optionally the fra...
This represents an "assembler immediate".
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
LLVM Value Representation.
Base class for the full range of assembler expressions which are needed for parsing.
const MCSymbolRefExpr * getSymB() const
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.