LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Friends | List of all members
llvm::MCSymbol Class Reference

#include <MCSymbol.h>

Public Member Functions

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

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

const MCSymbol & MCSymbol::AliasedSymbol ( ) const
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
const MCSection& llvm::MCSymbol::getSection ( ) const
inline
const MCExpr* llvm::MCSymbol::getVariableValue ( ) const
inline
bool llvm::MCSymbol::isAbsolute ( ) const
inline

isAbsolute - Check if this is an absolute symbol.

Definition at line 105 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 89 of file MCSymbol.h.

References llvm::ARMBuildAttrs::Section.

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

bool llvm::MCSymbol::isInSection ( ) const
inline

isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).

Definition at line 95 of file MCSymbol.h.

References isAbsolute(), and isDefined().

Referenced by llvm::AsmPrinter::EmitSectionOffset(), getSection(), llvm::MCWin64EHUnwindEmitter::GetSectionSuffix(), llvm::MCAssembler::isSymbolLinkerVisible(), and llvm::MachObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl().

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 125 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 117 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 120 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.

void MCSymbol::setVariableValue ( const MCExpr Value)

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: