LLVM
8.0.1
|
This represents an "assembler immediate". More...
#include "llvm/MC/MCValue.h"
Public Member Functions | |
MCValue ()=default | |
int64_t | getConstant () const |
const MCSymbolRefExpr * | getSymA () const |
const MCSymbolRefExpr * | getSymB () const |
uint32_t | getRefKind () const |
bool | isAbsolute () const |
Is this an absolute (as opposed to relocatable) value. More... | |
void | print (raw_ostream &OS) const |
Print the value to the stream OS . More... | |
void | dump () const |
Print the value to stderr. More... | |
MCSymbolRefExpr::VariantKind | getAccessVariant () const |
Static Public Member Functions | |
static MCValue | get (const MCSymbolRefExpr *SymA, const MCSymbolRefExpr *SymB=nullptr, int64_t Val=0, uint32_t RefKind=0) |
static MCValue | get (int64_t Val) |
This represents an "assembler immediate".
In its most general form, this can hold ":Kind:(SymbolA - SymbolB + imm64)". Not all targets supports relocations of this general form, but we need to represent this anyway.
In general both SymbolA and SymbolB will also have a modifier analogous to the top-level Kind. Current targets are not expected to make use of both though. The choice comes down to whether relocation modifiers apply to the closest symbol or the whole expression.
Note that this class must remain a simple POD value class, because we need it to live in unions etc.
|
default |
LLVM_DUMP_METHOD void MCValue::dump | ( | ) | const |
Print the value to stderr.
Definition at line 42 of file MCValue.cpp.
References llvm::dbgs(), and print().
Referenced by isAbsolute().
|
inlinestatic |
Definition at line 63 of file MCValue.h.
Referenced by llvm::LanaiMCExpr::evaluateAsRelocatableImpl(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), llvm::AArch64MCExpr::evaluateAsRelocatableImpl(), and llvm::RISCVMCExpr::getPCRelHiFixup().
|
inlinestatic |
MCSymbolRefExpr::VariantKind MCValue::getAccessVariant | ( | ) | const |
Definition at line 47 of file MCValue.cpp.
References B, llvm::MCSymbolRefExpr::getKind(), getSymA(), getSymB(), Kind, llvm_unreachable, llvm::MCSymbolRefExpr::VK_None, and llvm::MCSymbolRefExpr::VK_WEAKREF.
Referenced by getAccessVariant(), getPLTReloc(), llvm::AVRELFObjectWriter::getRelocType(), getRelocType32(), and isAbsolute().
|
inline |
Definition at line 47 of file MCValue.h.
Referenced by canGoAfterDWARF(), canUseLocalRelocation(), encodeBase64StringEntry(), llvm::AVRMCExpr::evaluateAsConstant(), llvm::RISCVMCExpr::evaluateAsConstant(), llvm::PPCMCExpr::evaluateAsConstant(), llvm::LanaiMCExpr::evaluateAsRelocatableImpl(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), llvm::AArch64MCExpr::evaluateAsRelocatableImpl(), getARMFixupKindMachOInfo(), llvm::MCAssembler::getAtom(), getFixupKindLog2Size(), llvm::X86_64MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::RISCVMCExpr::getPCRelHiFixup(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), handleIndirectSymViaGOTPCRel(), incrementLoc(), isShiftedUIntAtAnyPosition(), isWeak(), and print().
|
inline |
Definition at line 50 of file MCValue.h.
Referenced by adjustFixupValue(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), isNonILP32reloc(), llvm::MCAssembler::isThumbFunc(), and print().
|
inline |
Definition at line 48 of file MCValue.h.
Referenced by llvm::AVRAsmBackend::adjustFixupValue(), llvm::ARMAsmBackend::adjustFixupValue(), canGoAfterDWARF(), canUseLocalRelocation(), encodeBase64StringEntry(), llvm::LanaiMCExpr::evaluateAsRelocatableImpl(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::RISCVMCExpr::evaluateAsRelocatableImpl(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), llvm::AArch64MCExpr::evaluateAsRelocatableImpl(), llvm::MCAssembler::Finish(), getAccessVariant(), getARMFixupKindMachOInfo(), llvm::MCAssembler::getAtom(), llvm::MCAsmLayout::getBaseSymbol(), getFixupKindLog2Size(), getFixupKindNumBytes(), getFixupOffset(), llvm::RISCVMCExpr::getPCRelHiFixup(), getRelocType(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), handleIndirectSymViaGOTPCRel(), incrementLoc(), IsEventType(), IsFunctionType(), IsGlobalType(), isNonILP32reloc(), isShiftedUIntAtAnyPosition(), llvm::MCAssembler::isThumbFunc(), isWeak(), print(), and llvm::ARMAsmBackend::shouldForceRelocation().
|
inline |
Definition at line 49 of file MCValue.h.
Referenced by canGoAfterDWARF(), canUseLocalRelocation(), encodeBase64StringEntry(), llvm::LanaiMCExpr::evaluateAsRelocatableImpl(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::MCExpr::evaluateAsRelocatableImpl(), llvm::RISCVMCExpr::evaluateAsRelocatableImpl(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), llvm::AArch64MCExpr::evaluateAsRelocatableImpl(), getAccessVariant(), getARMFixupKindMachOInfo(), llvm::MCAssembler::getAtom(), llvm::MCAsmLayout::getBaseSymbol(), getFixupKindLog2Size(), getFixupOffset(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), handleIndirectSymViaGOTPCRel(), incrementLoc(), isNonILP32reloc(), isShiftedUIntAtAnyPosition(), llvm::MCAssembler::isThumbFunc(), isWeak(), and print().
|
inline |
Is this an absolute (as opposed to relocatable) value.
Definition at line 53 of file MCValue.h.
References dump(), getAccessVariant(), and print().
Referenced by canUseLocalRelocation(), llvm::AVRMCExpr::evaluateAsConstant(), llvm::RISCVMCExpr::evaluateAsConstant(), llvm::PPCMCExpr::evaluateAsConstant(), llvm::AVRMCExpr::evaluateAsRelocatableImpl(), llvm::MipsMCExpr::evaluateAsRelocatableImpl(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), getARMFixupKindMachOInfo(), llvm::MCAssembler::getAtom(), getFixupKindLog2Size(), getFixupOffset(), getRelocType(), handleIndirectSymViaGOTPCRel(), and print().
void MCValue::print | ( | raw_ostream & | OS | ) | const |
Print the value to the stream OS
.
Definition at line 19 of file MCValue.cpp.
References getConstant(), getRefKind(), getSymA(), getSymB(), and isAbsolute().
Referenced by dump(), getAccessVariant(), and isAbsolute().