LLVM API Documentation

llvm::MCValue Class Reference

#include <MCValue.h>

Collaboration diagram for llvm::MCValue:
[legend]

List of all members.

Public Member Functions

int64_t getConstant () const
MCSymbol * getSymA () const
MCSymbol * getSymB () const
bool isAbsolute () const
 isAbsolute - Is this an absolute (as opposed to relocatable) value.
const MCSection * getAssociatedSection () const
void print (raw_ostream &OS) const
 print - Print the value to the stream
void dump () const
 dump - Print the value to stderr.

Static Public Member Functions

static MCValue get (MCSymbol *SymA, MCSymbol *SymB=0, int64_t Val=0)
static MCValue get (int64_t Val)


Detailed Description

MCValue - This represents an "assembler immediate". In its most general form, this can hold "SymbolA - SymbolB + imm64". Not all targets supports relocations of this general form, but we need to represent this anyway.

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


Member Function Documentation

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

Definition at line 40 of file MCValue.h.

Referenced by print(), truncateToSize(), and WriteFileData().

MCSymbol* llvm::MCValue::getSymA (  )  const [inline]

Definition at line 41 of file MCValue.h.

Referenced by print(), and truncateToSize().

MCSymbol* llvm::MCValue::getSymB (  )  const [inline]

Definition at line 42 of file MCValue.h.

Referenced by print(), and truncateToSize().

bool llvm::MCValue::isAbsolute (  )  const [inline]

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

Definition at line 45 of file MCValue.h.

Referenced by print(), and WriteFileData().

const MCSection* llvm::MCValue::getAssociatedSection (  )  const [inline]

getAssociatedSection - For relocatable values, return the section the value is associated with.

Returns:
- The value's associated section, or null for external or constant values.

Definition at line 52 of file MCValue.h.

References llvm::MCSymbol::getSection().

void MCValue::print ( raw_ostream &  OS  )  const

void MCValue::dump (  )  const

dump - Print the value to stderr.

Definition at line 32 of file MCValue.cpp.

References llvm::errs(), and print().

static MCValue llvm::MCValue::get ( MCSymbol *  SymA,
MCSymbol *  SymB = 0,
int64_t  Val = 0 
) [inline, static]

static MCValue llvm::MCValue::get ( int64_t  Val  )  [inline, static]

Definition at line 71 of file MCValue.h.

References Cst, R, SymA, SymB, and Val.


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