LLVM API Documentation
#include <MCSymbol.h>
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 MCSection & | getSection () 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 MCExpr * | getVariableValue () const |
getVariableValue() - Get the value for variable symbols. | |
const MCSymbol & | AliasedSymbol () 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 |
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.
const MCSymbol & MCSymbol::AliasedSymbol | ( | ) | const |
Definition at line 42 of file MCSymbol.cpp.
References llvm::MCExpr::getKind(), llvm::MCSymbolRefExpr::getSymbol(), getVariableValue(), isVariable(), and llvm::MCExpr::SymbolRef.
Referenced by llvm::MCObjectWriter::IsSymbolRefDifferenceFullyResolved(), llvm::MCObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(), llvm::MachObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(), and llvm::MachObjectWriter::WriteNlist().
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().
const MCSection& llvm::MCSymbol::getSection | ( | ) | const [inline] |
getSection - Get the section associated with a defined, non-absolute symbol.
Definition at line 109 of file MCSymbol.h.
References isInSection(), and llvm::ARMBuildAttrs::Section.
Referenced by llvm::DwarfCompileUnit::addRange(), llvm::MCWinCOFFStreamer::BeginCOFFSymbolDef(), llvm::MachObjectWriter::ComputeSymbolTable(), llvm::MCWinCOFFStreamer::EmitCommonSymbol(), llvm::MCELFStreamer::EmitLabel(), llvm::AsmPrinter::EmitSectionOffset(), llvm::MCWinCOFFStreamer::EmitSymbolAttribute(), llvm::MCExpr::FindAssociatedSection(), llvm::MCELFStreamer::Flush(), llvm::WinEH::getSectionSuffix(), llvm::WinEH::getUnwindInfoSection(), llvm::MCAssembler::isSymbolLinkerVisible(), llvm::MCObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(), and llvm::MachObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl().
const MCExpr* llvm::MCSymbol::getVariableValue | ( | ) | const [inline] |
getVariableValue() - Get the value for variable symbols.
Definition at line 133 of file MCSymbol.h.
Referenced by AliasedSymbol(), llvm::MCAsmLayout::getBaseSymbol(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), getWeakRef(), llvm::MCAssembler::isThumbFunc(), and isUsedIn().
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] |
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
Definition at line 93 of file MCSymbol.h.
References isAbsolute(), and isDefined().
Referenced by llvm::MCWinCOFFStreamer::BeginCOFFSymbolDef(), llvm::MCWinCOFFStreamer::EmitCommonSymbol(), llvm::MCWinCOFFStreamer::EmitLocalCommonSymbol(), llvm::AsmPrinter::EmitSectionOffset(), llvm::MCWinCOFFStreamer::EmitSymbolAttribute(), getSection(), llvm::WinEH::getSectionSuffix(), llvm::WinEH::getUnwindInfoSection(), 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] |
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
Definition at line 98 of file MCSymbol.h.
References isDefined().
Referenced by llvm::MachObjectWriter::ComputeSymbolTable(), llvm::MachObjectWriter::doesSymbolRequireExternRelocation(), llvm::AsmPrinter::EmitConstantPool(), llvm::AsmPrinter::EmitFunctionEntryLabel(), llvm::MCWinCOFFStreamer::EmitLabel(), llvm::MCELFStreamer::EmitLabel(), llvm::MachObjectWriter::getSymbolAddress(), llvm::MCObjectWriter::IsSymbolRefDifferenceFullyResolved(), and llvm::MachObjectWriter::WriteNlist().
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] |
isVariable - Check if this is a variable symbol.
Definition at line 128 of file MCSymbol.h.
Referenced by AliasedSymbol(), llvm::MCStreamer::EmitLabel(), llvm::MCAsmLayout::getBaseSymbol(), llvm::MachObjectWriter::getSymbolAddress(), getSymbolOffsetImpl(), getWeakRef(), llvm::MCAssembler::isThumbFunc(), and isUsedIn().
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.
void MCSymbol::setVariableValue | ( | const MCExpr * | Value | ) |
Definition at line 54 of file MCSymbol.cpp.
References llvm::MCExpr::FindAssociatedSection(), setSection(), and setUndefined().
Referenced by llvm::MCStreamer::EmitAssignment(), and llvm::MCELFStreamer::EmitWeakReference().
friend class MCContext [friend] |
Definition at line 61 of file MCSymbol.h.
friend class MCExpr [friend] |
Definition at line 60 of file MCSymbol.h.