LLVM API Documentation

Public Member Functions | Static Public Member Functions
llvm::MCValue Class Reference

#include <MCValue.h>

List of all members.

Public Member Functions

int64_t getConstant () const
const MCSymbolRefExprgetSymA () const
const MCSymbolRefExprgetSymB () 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)

Detailed Description

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.

Definition at line 43 of file MCValue.h.


Member Function Documentation

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]
static MCValue llvm::MCValue::get ( int64_t  Val) [inline, static]

Definition at line 77 of file MCValue.h.

int64_t llvm::MCValue::getConstant ( ) const [inline]
uint32_t llvm::MCValue::getRefKind ( ) const [inline]

Definition at line 52 of file MCValue.h.

Referenced by 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().


The documentation for this class was generated from the following files: