LLVM API Documentation
#include <MCValue.h>
Public Member Functions | |
int64_t | getConstant () const |
const MCSymbolRefExpr * | getSymA () const |
const MCSymbolRefExpr * | getSymB () const |
uint32_t | getRefKind () const |
bool | isAbsolute () const |
isAbsolute - Is this an absolute (as opposed to relocatable) value. | |
void | print (raw_ostream &OS, const MCAsmInfo *MAI) const |
print - Print the value to the stream OS . | |
void | dump () const |
dump - Print the value to stderr. | |
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) |
MCValue - 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.
In the general form, SymbolB can only be defined if SymbolA is, and both must be in the same (non-external) section. The latter constraint is not enforced, since a symbol's section may not be known at construction.
Note that this class must remain a simple POD value class, because we need it to live in unions etc.
void MCValue::dump | ( | ) | const |
dump - Print the value to stderr.
Definition at line 41 of file MCValue.cpp.
References llvm::dbgs(), and print().
static MCValue llvm::MCValue::get | ( | const MCSymbolRefExpr * | SymA, |
const MCSymbolRefExpr * | SymB = nullptr , |
||
int64_t | Val = 0 , |
||
uint32_t | RefKind = 0 |
||
) | [inline, static] |
Definition at line 65 of file MCValue.h.
Referenced by llvm::MCExpr::EvaluateAsRelocatableImpl(), llvm::PPCMCExpr::EvaluateAsRelocatableImpl(), and llvm::AArch64MCExpr::EvaluateAsRelocatableImpl().
static MCValue llvm::MCValue::get | ( | int64_t | Val | ) | [inline, static] |
Definition at line 46 of file MCValue.cpp.
References llvm::ARM_PROC::A, llvm::MCSymbolRefExpr::getKind(), getSymA(), getSymB(), llvm_unreachable, llvm::MCSymbolRefExpr::VK_None, and llvm::MCSymbolRefExpr::VK_WEAKREF.
Referenced by getAccessVariant().
int64_t llvm::MCValue::getConstant | ( | ) | const [inline] |
Definition at line 49 of file MCValue.h.
Referenced by llvm::PPCMCExpr::EvaluateAsConstant(), llvm::PPCMCExpr::EvaluateAsRelocatableImpl(), llvm::AArch64MCExpr::EvaluateAsRelocatableImpl(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), and print().
uint32_t llvm::MCValue::getRefKind | ( | ) | const [inline] |
const MCSymbolRefExpr* llvm::MCValue::getSymA | ( | ) | const [inline] |
Definition at line 50 of file MCValue.h.
Referenced by llvm::MCExpr::EvaluateAsRelocatableImpl(), llvm::PPCMCExpr::EvaluateAsRelocatableImpl(), llvm::AArch64MCExpr::EvaluateAsRelocatableImpl(), getAccessVariant(), llvm::MCAsmLayout::getBaseSymbol(), getRelocType(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), llvm::MachObjectWriter::markAbsoluteVariableSymbols(), and print().
const MCSymbolRefExpr* llvm::MCValue::getSymB | ( | ) | const [inline] |
Definition at line 51 of file MCValue.h.
Referenced by llvm::MCExpr::EvaluateAsRelocatableImpl(), llvm::PPCMCExpr::EvaluateAsRelocatableImpl(), llvm::AArch64MCExpr::EvaluateAsRelocatableImpl(), getAccessVariant(), llvm::MCAsmLayout::getBaseSymbol(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), llvm::MachObjectWriter::markAbsoluteVariableSymbols(), and print().
bool llvm::MCValue::isAbsolute | ( | ) | const [inline] |
isAbsolute - Is this an absolute (as opposed to relocatable) value.
Definition at line 55 of file MCValue.h.
Referenced by evaluate(), llvm::PPCMCExpr::EvaluateAsConstant(), llvm::PPCMCExpr::EvaluateAsRelocatableImpl(), getRelocType(), and print().
void MCValue::print | ( | raw_ostream & | OS, |
const MCAsmInfo * | MAI | ||
) | const |
print - Print the value to the stream OS
.
Definition at line 18 of file MCValue.cpp.
References getConstant(), getRefKind(), getSymA(), getSymB(), isAbsolute(), and llvm::MCExpr::print().
Referenced by dump().