LLVM  3.7.0
Public Member Functions | Static Public Member Functions | List of all members
llvm::MCValue Class Reference

This represents an "assembler immediate". More...

#include <MCValue.h>

Public Member Functions

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

Detailed Description

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 44 of file MCValue.h.

Member Function Documentation

void MCValue::dump ( ) const

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 
)
inlinestatic
static MCValue llvm::MCValue::get ( int64_t  Val)
inlinestatic

Definition at line 78 of file MCValue.h.

MCSymbolRefExpr::VariantKind MCValue::getAccessVariant ( ) const
int64_t llvm::MCValue::getConstant ( ) const
inline
uint32_t llvm::MCValue::getRefKind ( ) const
inline

Definition at line 53 of file MCValue.h.

Referenced by print().

const MCSymbolRefExpr* llvm::MCValue::getSymA ( ) const
inline
const MCSymbolRefExpr* llvm::MCValue::getSymB ( ) const
inline
bool llvm::MCValue::isAbsolute ( ) const
inline

Is this an absolute (as opposed to relocatable) value.

Definition at line 56 of file MCValue.h.

Referenced by llvm::PPCMCExpr::evaluateAsConstant(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), getRelocType(), handleIndirectSymViaGOTPCRel(), and print().

void MCValue::print ( raw_ostream OS) const

Print the value to the stream OS.

Definition at line 18 of file MCValue.cpp.

References getConstant(), getRefKind(), getSymA(), getSymB(), and isAbsolute().

Referenced by dump().


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