LLVM
17.0.0git
|
#include "Target/RISCV/MCTargetDesc/RISCVMCExpr.h"
Public Types | |
enum | VariantKind { VK_RISCV_None, VK_RISCV_LO, VK_RISCV_HI, VK_RISCV_PCREL_LO, VK_RISCV_PCREL_HI, VK_RISCV_GOT_HI, VK_RISCV_TPREL_LO, VK_RISCV_TPREL_HI, VK_RISCV_TPREL_ADD, VK_RISCV_TLS_GOT_HI, VK_RISCV_TLS_GD_HI, VK_RISCV_CALL, VK_RISCV_CALL_PLT, VK_RISCV_32_PCREL, VK_RISCV_Invalid } |
![]() | |
enum | ExprKind : uint8_t { Binary, Constant, SymbolRef, Unary, Target } |
Public Member Functions | |
VariantKind | getKind () const |
const MCExpr * | getSubExpr () const |
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 fragment containing it. More... | |
void | printImpl (raw_ostream &OS, const MCAsmInfo *MAI) const override |
bool | evaluateAsRelocatableImpl (MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override |
void | visitUsedExpr (MCStreamer &Streamer) const override |
MCFragment * | findAssociatedFragment () const override |
void | fixELFSymbolsInTLSFixups (MCAssembler &Asm) const override |
bool | evaluateAsConstant (int64_t &Res) const |
![]() | |
virtual bool | isEqualTo (const MCExpr *x) const |
virtual bool | inlineAssignedExpr () const |
![]() | |
MCExpr (const MCExpr &)=delete | |
MCExpr & | operator= (const MCExpr &)=delete |
ExprKind | getKind () const |
SMLoc | getLoc () const |
void | print (raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const |
void | dump () const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAsmLayout &Layout, const SectionAddrMap &Addrs) const |
Try to evaluate the expression to an absolute value. More... | |
bool | evaluateAsAbsolute (int64_t &Res) const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAssembler &Asm) const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAssembler *Asm) const |
bool | evaluateAsAbsolute (int64_t &Res, const MCAsmLayout &Layout) const |
bool | evaluateKnownAbsolute (int64_t &Res, const MCAsmLayout &Layout) const |
bool | evaluateAsRelocatable (MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const |
Try to evaluate the expression to a relocatable value, i.e. More... | |
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. More... | |
MCFragment * | findAssociatedFragment () const |
Find the "associated section" for this expression, which is currently defined as the absolute section for constants, or otherwise the section associated with the first defined symbol in the expression. More... | |
Static Public Member Functions | |
static const RISCVMCExpr * | create (const MCExpr *Expr, VariantKind Kind, MCContext &Ctx) |
static bool | classof (const MCExpr *E) |
static bool | classof (const RISCVMCExpr *) |
static VariantKind | getVariantKindForName (StringRef name) |
static StringRef | getVariantKindName (VariantKind Kind) |
![]() | |
static bool | classof (const MCExpr *E) |
Additional Inherited Members | |
![]() | |
MCTargetExpr () | |
virtual | ~MCTargetExpr ()=default |
![]() | |
MCExpr (ExprKind Kind, SMLoc Loc, unsigned SubclassData=0) | |
bool | evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, const MCAsmLayout *Layout, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) const |
unsigned | getSubclassData () const |
Definition at line 23 of file RISCVMCExpr.h.
Definition at line 25 of file RISCVMCExpr.h.
Definition at line 79 of file RISCVMCExpr.h.
References E, and llvm::MCExpr::Target.
|
inlinestatic |
Definition at line 83 of file RISCVMCExpr.h.
|
static |
Definition at line 31 of file RISCVMCExpr.cpp.
Referenced by llvm::RISCVMCAsmInfo::getExprForFDESymbol(), and lowerSymbolOperand().
bool RISCVMCExpr::evaluateAsConstant | ( | int64_t & | Res | ) | const |
Definition at line 204 of file RISCVMCExpr.cpp.
References llvm::MCExpr::evaluateAsRelocatable(), getSubExpr(), VK_RISCV_CALL, VK_RISCV_CALL_PLT, VK_RISCV_GOT_HI, VK_RISCV_PCREL_HI, VK_RISCV_PCREL_LO, VK_RISCV_TLS_GD_HI, VK_RISCV_TLS_GOT_HI, VK_RISCV_TPREL_ADD, VK_RISCV_TPREL_HI, and VK_RISCV_TPREL_LO.
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 93 of file RISCVMCExpr.cpp.
References llvm::MCExpr::evaluateAsRelocatable(), llvm::MCValue::get(), llvm::MCValue::getConstant(), getKind(), getSubExpr(), llvm::MCValue::getSymA(), llvm::MCValue::getSymB(), and VK_RISCV_None.
|
inlineoverridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 71 of file RISCVMCExpr.h.
References llvm::MCExpr::findAssociatedFragment(), and getSubExpr().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 191 of file RISCVMCExpr.cpp.
References llvm::HexStyle::Asm, fixELFSymbolsInTLSFixupsImpl(), getKind(), getSubExpr(), VK_RISCV_TLS_GD_HI, VK_RISCV_TLS_GOT_HI, and VK_RISCV_TPREL_HI.
|
inline |
Definition at line 56 of file RISCVMCExpr.h.
Referenced by evaluateAsRelocatableImpl(), fixELFSymbolsInTLSFixups(), and printImpl().
const MCFixup * RISCVMCExpr::getPCRelHiFixup | ( | const MCFragment ** | DFOut | ) | const |
Get the corresponding PC-relative HI fixup that a VK_RISCV_PCREL_LO points to, and optionally the fragment containing it.
Definition at line 50 of file RISCVMCExpr.cpp.
References DF, llvm::MCExpr::evaluateAsRelocatable(), F, llvm::RISCV::fixup_riscv_got_hi20, llvm::RISCV::fixup_riscv_pcrel_hi20, llvm::RISCV::fixup_riscv_tls_gd_hi20, llvm::RISCV::fixup_riscv_tls_got_hi20, llvm::MCSymbol::getFragment(), llvm::MCSymbol::getOffset(), getSubExpr(), llvm::MCValue::getSymA(), llvm::MCSymbolRefExpr::getSymbol(), and llvm::Offset.
Definition at line 58 of file RISCVMCExpr.h.
Referenced by evaluateAsConstant(), evaluateAsRelocatableImpl(), findAssociatedFragment(), fixELFSymbolsInTLSFixups(), getPCRelHiFixup(), and visitUsedExpr().
|
static |
Definition at line 112 of file RISCVMCExpr.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), name, VK_RISCV_GOT_HI, VK_RISCV_HI, VK_RISCV_Invalid, VK_RISCV_LO, VK_RISCV_PCREL_HI, VK_RISCV_PCREL_LO, VK_RISCV_TLS_GD_HI, VK_RISCV_TLS_GOT_HI, VK_RISCV_TPREL_ADD, VK_RISCV_TPREL_HI, and VK_RISCV_TPREL_LO.
|
static |
Definition at line 127 of file RISCVMCExpr.cpp.
References llvm_unreachable, VK_RISCV_32_PCREL, VK_RISCV_CALL, VK_RISCV_CALL_PLT, VK_RISCV_GOT_HI, VK_RISCV_HI, VK_RISCV_Invalid, VK_RISCV_LO, VK_RISCV_None, VK_RISCV_PCREL_HI, VK_RISCV_PCREL_LO, VK_RISCV_TLS_GD_HI, VK_RISCV_TLS_GOT_HI, VK_RISCV_TPREL_ADD, VK_RISCV_TPREL_HI, and VK_RISCV_TPREL_LO.
Referenced by printImpl().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 36 of file RISCVMCExpr.cpp.
References getKind(), getVariantKindName(), llvm::MCExpr::print(), VK_RISCV_CALL, VK_RISCV_CALL_PLT, and VK_RISCV_None.
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 108 of file RISCVMCExpr.cpp.
References getSubExpr(), and llvm::MCStreamer::visitUsedExpr().