LLVM API Documentation
#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 MCSection & | getSection () 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 MCExpr * | getVariableValue () const |
getVariableValue() - Get the value for variable symbols. More... | |
const MCSymbol & | AliasedSymbol () const |
void | setVariableValue (const MCExpr *Value) |
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::MCELFObjectTargetWriter::undefinedExplicitRelSym().
void MCSymbol::dump | ( | ) | const |
dump - Print the value to stderr.
Definition at line 91 of file MCSymbol.cpp.
References llvm::dbgs(), and print().
|
inline |
getName - Get the symbol name.
Definition at line 70 of file MCSymbol.h.
Referenced by llvm::MachObjectWriter::BindIndirectSymbols(), llvm::MachObjectWriter::ComputeSymbolTable(), llvm::AsmPrinter::doFinalization(), llvm::DwarfException::EmitExceptionTable(), llvm::MipsAsmPrinter::EmitFunctionBodyEnd(), llvm::MipsAsmPrinter::EmitFunctionEntryLabel(), llvm::AsmPrinter::EmitFunctionEntryLabel(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::MipsTargetAsmStreamer::emitMipsHackSTOCG(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), GetAnonSym(), GetLazyPtr(), llvm::MachObjectWriter::getSymbolAddress(), llvm::MCAsmLayout::getSymbolOffset(), llvm::MCGenDwarfLabelEntry::Make(), llvm::MCExpr::print(), print(), llvm::DIELabel::print(), llvm::DIEDelta::print(), llvm::MipsAsmPrinter::printOperand(), llvm::NVPTXInstPrinter::printProtoIdent(), llvm::MCSectionELF::PrintSwitchToSection(), llvm::X86AsmPrinter::printSymbolOperand(), llvm::MCStreamer::RecordProcStart(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileMachO::shouldEmitUsedDirectiveFor(), SortSymbolPair(), StartsWithGlobalOffsetTable(), llvm::MachObjectWriter::WriteNlist(), and llvm::MachObjectWriter::WriteObject().
|
inline |
getSection - Get the section associated with a defined, non-absolute symbol.
Definition at line 111 of file MCSymbol.h.
References isInSection(), and llvm::ARMBuildAttrs::Section.
Referenced by llvm::MachObjectWriter::ComputeSymbolTable(), llvm::MCELFStreamer::EmitLabel(), llvm::AsmPrinter::EmitSectionOffset(), llvm::MCExpr::FindAssociatedSection(), llvm::MCELFStreamer::Flush(), llvm::MCWin64EHUnwindEmitter::GetSectionSuffix(), llvm::MCAssembler::isSymbolLinkerVisible(), llvm::MCObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(), and llvm::MachObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl().
|
inline |
getVariableValue() - Get the value for variable symbols.
Definition at line 137 of file MCSymbol.h.
References isVariable().
Referenced by AliasedSymbol(), llvm::MachObjectWriter::getSymbolAddress(), llvm::MCAsmLayout::getSymbolOffset(), isUsedIn(), and llvm::MachObjectWriter::markAbsoluteVariableSymbols().
|
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().
|
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().
|
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().
|
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().
|
inline |
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
Definition at line 100 of file MCSymbol.h.
References isDefined().
Referenced by llvm::MachObjectWriter::ComputeSymbolTable(), llvm::MachObjectWriter::doesSymbolRequireExternRelocation(), llvm::AsmPrinter::EmitFunctionEntryLabel(), llvm::MCELFStreamer::EmitLabel(), llvm::MachObjectWriter::getSymbolAddress(), llvm::MCAsmLayout::getSymbolOffset(), llvm::MCObjectWriter::IsSymbolRefDifferenceFullyResolved(), and llvm::MachObjectWriter::WriteNlist().
|
inline |
isUsed - Check if this is used.
Definition at line 79 of file MCSymbol.h.
|
inline |
isVariable - Check if this is a variable symbol.
Definition at line 132 of file MCSymbol.h.
Referenced by AliasedSymbol(), llvm::MCStreamer::EmitDebugLabel(), llvm::MCStreamer::EmitLabel(), llvm::MachObjectWriter::getSymbolAddress(), llvm::MCAsmLayout::getSymbolOffset(), getVariableValue(), isUsedIn(), and llvm::MachObjectWriter::markAbsoluteVariableSymbols().
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<<().
|
inline |
setAbsolute - Mark the symbol as absolute.
Definition at line 125 of file MCSymbol.h.
References llvm::ARMBuildAttrs::Section.
Referenced by llvm::X86AsmPrinter::EmitStartOfAsmFile().
|
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().
|
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().
|
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::MCObjectStreamer::EmitAssignment(), and llvm::MCELFStreamer::EmitWeakReference().
|
friend |
Definition at line 61 of file MCSymbol.h.
|
friend |
Definition at line 60 of file MCSymbol.h.