LLVM API Documentation

Public Member Functions | Friends
llvm::MCSymbol Class Reference

#include <MCSymbol.h>

List of all members.

Public Member Functions

StringRef getName () const
 getName - Get the symbol name.
bool isDefined () const
bool isInSection () const
bool isUndefined () const
 isUndefined - Check if this symbol undefined (i.e., implicitly defined).
bool isAbsolute () const
 isAbsolute - Check if this is an absolute symbol.
const MCSectiongetSection () const
void setSection (const MCSection &S)
 setSection - Mark the symbol as defined in the section S.
void setUndefined ()
 setUndefined - Mark the symbol as undefined.
void setAbsolute ()
 setAbsolute - Mark the symbol as absolute.
bool isVariable () const
 isVariable - Check if this is a variable symbol.
const MCExprgetVariableValue () const
 getVariableValue() - Get the value for variable symbols.
const MCSymbolAliasedSymbol () const
void setVariableValue (const MCExpr *Value)
void print (raw_ostream &OS) const
 print - Print the value to the stream OS.
void dump () const
 dump - Print the value to stderr.
Accessors
bool isTemporary () const
 isTemporary - Check if this is an assembler temporary symbol.
bool isUsed () const
 isUsed - Check if this is used.
void setUsed (bool Value) const

Friends

class MCExpr
class MCContext

Detailed Description

MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created and unique'd by the MCContext class. MCSymbols should only be constructed with valid names for the object file.

If the symbol is defined/emitted into the current translation unit, the Section member is set to indicate what section it lives in. Otherwise, if it is a reference to an external entity, it has a null section.

Definition at line 33 of file MCSymbol.h.


Member Function Documentation

void MCSymbol::dump ( ) const

dump - Print the value to stderr.

Definition at line 91 of file MCSymbol.cpp.

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

StringRef llvm::MCSymbol::getName ( ) const [inline]

getName - Get the symbol name.

Definition at line 70 of file MCSymbol.h.

References Name.

Referenced by llvm::MachObjectWriter::BindIndirectSymbols(), llvm::MachObjectWriter::ComputeSymbolTable(), llvm::MipsTargetAsmStreamer::emitDirectiveCpsetup(), llvm::MipsTargetELFStreamer::emitDirectiveCpsetup(), llvm::MipsTargetAsmStreamer::emitDirectiveEnt(), llvm::EHStreamer::emitExceptionTable(), llvm::MipsAsmPrinter::EmitFunctionBodyEnd(), llvm::AsmPrinter::EmitFunctionEntryLabel(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), GetAnonSym(), llvm::MCContext::getAssociativeCOFFSection(), llvm::MCAsmLayout::getBaseSymbol(), llvm::TargetLoweringObjectFileELF::getCFIPersonalitySymbol(), llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), llvm::MCSectionELF::getLabelBeginName(), llvm::MCSectionELF::getLabelEndName(), getLabelOffset(), GetLazyPtr(), getStaticStructorSection(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), hasGOTReference(), llvm::MCGenDwarfLabelEntry::Make(), llvm::MCExpr::print(), print(), llvm::DIELabel::print(), llvm::DIEDelta::print(), llvm::MipsAsmPrinter::printOperand(), llvm::NVPTXInstPrinter::printProtoIdent(), llvm::MCSectionELF::PrintSwitchToSection(), printSymbolOperand(), llvm::PPCInstPrinter::printTLSCall(), llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal(), SortSymbolPair(), StartsWithGlobalOffsetTable(), llvm::MachObjectWriter::WriteNlist(), and llvm::MachObjectWriter::WriteObject().

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

isAbsolute - Check if this is an absolute symbol.

Definition at line 103 of file MCSymbol.h.

References llvm::ARMBuildAttrs::Section.

Referenced by llvm::MachObjectWriter::ComputeSymbolTable(), isInSection(), and llvm::MachObjectWriter::WriteNlist().

bool llvm::MCSymbol::isDefined ( ) const [inline]

isDefined - Check if this symbol is defined (i.e., it has an address).

Defined symbols are either absolute or in some section.

Definition at line 87 of file MCSymbol.h.

References llvm::ARMBuildAttrs::Section.

Referenced by llvm::AsmPrinter::EmitFunctionBody(), llvm::MCExpr::EvaluateAsRelocatableImpl(), isInSection(), isUndefined(), llvm::MachineModuleInfo::TidyLandingPads(), llvm::MMIAddrLabelMap::UpdateForDeletedBlock(), and llvm::MachObjectWriter::WriteNlist().

bool llvm::MCSymbol::isInSection ( ) const [inline]
bool llvm::MCSymbol::isTemporary ( ) const [inline]

isTemporary - Check if this is an assembler temporary symbol.

Definition at line 76 of file MCSymbol.h.

Referenced by llvm::MCAssembler::isSymbolLinkerVisible(), llvm::MachObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(), and llvm::MCGenDwarfLabelEntry::Make().

bool llvm::MCSymbol::isUndefined ( ) const [inline]
bool llvm::MCSymbol::isUsed ( ) const [inline]

isUsed - Check if this is used.

Definition at line 79 of file MCSymbol.h.

bool llvm::MCSymbol::isVariable ( ) const [inline]
void MCSymbol::print ( raw_ostream OS) const

print - Print the value to the stream OS.

Definition at line 67 of file MCSymbol.cpp.

References llvm::CallingConv::C, getName(), I, NameNeedsQuoting(), and llvm::StringRef::size().

Referenced by dump(), and llvm::operator<<().

void llvm::MCSymbol::setAbsolute ( ) [inline]

setAbsolute - Mark the symbol as absolute.

Definition at line 123 of file MCSymbol.h.

References llvm::ARMBuildAttrs::Section.

Referenced by llvm::X86AsmPrinter::EmitStartOfAsmFile().

void llvm::MCSymbol::setSection ( const MCSection S) [inline]

setSection - Mark the symbol as defined in the section S.

Definition at line 115 of file MCSymbol.h.

References llvm::ARMBuildAttrs::Section.

Referenced by llvm::MCStreamer::AssignSection(), and setVariableValue().

void llvm::MCSymbol::setUndefined ( ) [inline]

setUndefined - Mark the symbol as undefined.

Definition at line 118 of file MCSymbol.h.

References llvm::ARMBuildAttrs::Section.

Referenced by llvm::MCStreamer::AssignSection(), and setVariableValue().

void llvm::MCSymbol::setUsed ( bool  Value) const [inline]

Definition at line 80 of file MCSymbol.h.


Friends And Related Function Documentation

friend class MCContext [friend]

Definition at line 61 of file MCSymbol.h.

friend class MCExpr [friend]

Definition at line 60 of file MCSymbol.h.


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