LLVM
8.0.1
|
#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_CALL, VK_RISCV_Invalid } |
Public Types inherited from llvm::MCExpr | |
enum | ExprKind { Binary, Constant, SymbolRef, Unary, Target } |
Public Member Functions | |
VariantKind | getKind () const |
const MCExpr * | getSubExpr () const |
const MCFixup * | getPCRelHiFixup () const |
Get the MCExpr of the VK_RISCV_PCREL_HI Fixup that the VK_RISCV_PCREL_LO points to. 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 |
Public Member Functions inherited from llvm::MCTargetExpr | |
virtual bool | isEqualTo (const MCExpr *x) const |
virtual bool | inlineAssignedExpr () const |
Public Member Functions inherited from llvm::MCExpr | |
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 Public Member Functions inherited from llvm::MCTargetExpr | |
static bool | classof (const MCExpr *E) |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::MCTargetExpr | |
MCTargetExpr () | |
virtual | ~MCTargetExpr ()=default |
Protected Member Functions inherited from llvm::MCExpr | |
MCExpr (ExprKind Kind, SMLoc Loc) | |
bool | evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, const MCAsmLayout *Layout, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) const |
Definition at line 24 of file RISCVMCExpr.h.
Enumerator | |
---|---|
VK_RISCV_None | |
VK_RISCV_LO | |
VK_RISCV_HI | |
VK_RISCV_PCREL_LO | |
VK_RISCV_PCREL_HI | |
VK_RISCV_CALL | |
VK_RISCV_Invalid |
Definition at line 26 of file RISCVMCExpr.h.
Definition at line 76 of file RISCVMCExpr.h.
References llvm::MCExpr::getKind(), and llvm::MCExpr::Target.
|
inlinestatic |
Definition at line 80 of file RISCVMCExpr.h.
References getVariantKindForName(), getVariantKindName(), and name.
|
static |
Definition at line 29 of file RISCVMCExpr.cpp.
Referenced by convertFPR32ToFPR64(), llvm::createRISCVMCCodeEmitter(), and lowerSymbolOperand().
bool RISCVMCExpr::evaluateAsConstant | ( | int64_t & | Res | ) | const |
Definition at line 175 of file RISCVMCExpr.cpp.
References llvm::MCExpr::evaluateAsRelocatable(), llvm::MCValue::getConstant(), getSubExpr(), llvm::MCValue::isAbsolute(), llvm_unreachable, VK_RISCV_CALL, VK_RISCV_HI, VK_RISCV_LO, VK_RISCV_PCREL_HI, and VK_RISCV_PCREL_LO.
Referenced by fixELFSymbolsInTLSFixups().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 122 of file RISCVMCExpr.cpp.
References llvm::MCExpr::evaluateAsRelocatable(), getKind(), getSubExpr(), llvm::MCValue::getSymA(), llvm::MCValue::getSymB(), VK_RISCV_HI, VK_RISCV_LO, VK_RISCV_PCREL_HI, and VK_RISCV_PCREL_LO.
Referenced by getSubExpr().
|
inlineoverridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 67 of file RISCVMCExpr.h.
References llvm::MCExpr::findAssociatedFragment(), and getSubExpr().
Referenced by getPCRelHiFixup().
|
inlineoverridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 72 of file RISCVMCExpr.h.
References evaluateAsConstant().
|
inline |
Definition at line 52 of file RISCVMCExpr.h.
Referenced by llvm::createRISCVMCCodeEmitter(), evaluateAsRelocatableImpl(), and printImpl().
Get the MCExpr of the VK_RISCV_PCREL_HI Fixup that the VK_RISCV_PCREL_LO points to.
Definition at line 44 of file RISCVMCExpr.cpp.
References llvm::MCExpr::evaluateAsRelocatable(), llvm::MCExpr::evaluateAsValue(), F(), findAssociatedFragment(), llvm::MCExpr::findAssociatedFragment(), Fixup, llvm::RISCV::fixup_riscv_pcrel_hi20, llvm::MCValue::get(), llvm::MCValue::getConstant(), llvm::MCFixup::getKind(), llvm::MCFixup::getOffset(), llvm::MCSymbol::getOffset(), llvm::MCFragment::getParent(), llvm::MCSymbol::getSection(), getSubExpr(), llvm::MCValue::getSymA(), llvm::MCSymbolRefExpr::getSymbol(), llvm::MCFixup::getValue(), llvm::MCSymbol::isInSection(), and llvm::MCExpr::Target.
Referenced by getSubExpr().
Definition at line 54 of file RISCVMCExpr.h.
References evaluateAsRelocatableImpl(), Fixup, getPCRelHiFixup(), printImpl(), and visitUsedExpr().
Referenced by evaluateAsConstant(), evaluateAsRelocatableImpl(), findAssociatedFragment(), getPCRelHiFixup(), and visitUsedExpr().
|
static |
Definition at line 151 of file RISCVMCExpr.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), name, VK_RISCV_HI, VK_RISCV_Invalid, VK_RISCV_LO, VK_RISCV_PCREL_HI, and VK_RISCV_PCREL_LO.
Referenced by classof(), and convertFPR32ToFPR64().
|
static |
Definition at line 160 of file RISCVMCExpr.cpp.
References llvm_unreachable, VK_RISCV_HI, VK_RISCV_LO, VK_RISCV_PCREL_HI, and VK_RISCV_PCREL_LO.
Referenced by classof(), and printImpl().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 34 of file RISCVMCExpr.cpp.
References getKind(), getVariantKindName(), llvm::MCExpr::print(), VK_RISCV_CALL, and VK_RISCV_None.
Referenced by getSubExpr().
|
overridevirtual |
Implements llvm::MCTargetExpr.
Definition at line 147 of file RISCVMCExpr.cpp.
References getSubExpr(), and llvm::MCStreamer::visitUsedExpr().
Referenced by getSubExpr().