LLVM
15.0.0git
|
Instances of this class represent a uniqued identifier for a section in the current translation unit. More...
#include "llvm/MC/MCSection.h"
Public Types | |
enum | SectionVariant { SV_COFF = 0, SV_ELF, SV_GOFF, SV_MachO, SV_Wasm, SV_XCOFF, SV_SPIRV } |
enum | BundleLockStateType { NotBundleLocked, BundleLocked, BundleLockedAlignToEnd } |
Express the state of bundle locked groups while emitting code. More... | |
using | FragmentListType = iplist< MCFragment > |
using | const_iterator = FragmentListType::const_iterator |
using | iterator = FragmentListType::iterator |
using | const_reverse_iterator = FragmentListType::const_reverse_iterator |
using | reverse_iterator = FragmentListType::reverse_iterator |
Static Public Member Functions | |
static FragmentListType MCSection::* | getSublistAccess (MCFragment *) |
Support for MCFragment::getNextNode(). More... | |
Static Public Attributes | |
static constexpr unsigned | NonUniqueID = ~0U |
Protected Member Functions | |
MCSection (SectionVariant V, StringRef Name, SectionKind K, MCSymbol *Begin) | |
~MCSection () | |
Protected Attributes | |
StringRef | Name |
SectionVariant | Variant |
SectionKind | Kind |
Instances of this class represent a uniqued identifier for a section in the current translation unit.
The MCContext class uniques and creates these.
Definition at line 39 of file MCSection.h.
Definition at line 62 of file MCSection.h.
Definition at line 65 of file MCSection.h.
Definition at line 60 of file MCSection.h.
Definition at line 63 of file MCSection.h.
Definition at line 66 of file MCSection.h.
Express the state of bundle locked groups while emitting code.
Enumerator | |
---|---|
NotBundleLocked | |
BundleLocked | |
BundleLockedAlignToEnd |
Definition at line 54 of file MCSection.h.
Enumerator | |
---|---|
SV_COFF | |
SV_ELF | |
SV_GOFF | |
SV_MachO | |
SV_Wasm | |
SV_XCOFF | |
SV_SPIRV |
Definition at line 43 of file MCSection.h.
|
protected |
Definition at line 23 of file MCSection.cpp.
|
protecteddefault |
void MCSection::addPendingLabel | ( | MCSymbol * | label, |
unsigned | Subsection = 0 |
||
) |
Add a pending label for the requested subsection.
This label will be associated with a fragment in flushPendingLabels()
Definition at line 91 of file MCSection.cpp.
Referenced by llvm::MCObjectStreamer::addPendingLabel(), and llvm::MCObjectStreamer::flushPendingLabels().
|
inline |
Definition at line 178 of file MCSection.h.
Referenced by dump(), and llvm::MCAssembler::layout().
|
inline |
Definition at line 179 of file MCSection.h.
LLVM_DUMP_METHOD void MCSection::dump | ( | ) | const |
Definition at line 127 of file MCSection.cpp.
References begin(), end(), llvm::errs(), and it.
|
inline |
Definition at line 181 of file MCSection.h.
Referenced by dump(), and getSubsectionInsertionPoint().
|
inline |
Definition at line 182 of file MCSection.h.
void MCSection::flushPendingLabels | ( | ) |
Associate all pending labels with empty data fragments.
One fragment will be created for each subsection as necessary.
Definition at line 112 of file MCSection.cpp.
References F, getFragmentList(), getSubsectionInsertionPoint(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::insert().
void MCSection::flushPendingLabels | ( | MCFragment * | F, |
uint64_t | FOffset = 0 , |
||
unsigned | Subsection = 0 |
||
) |
Associate all pending labels in a subsection with a fragment.
Definition at line 95 of file MCSection.cpp.
References llvm::SmallVectorImpl< T >::erase(), and F.
Referenced by llvm::MCObjectStreamer::flushPendingLabels().
|
inline |
Definition at line 139 of file MCSection.h.
Referenced by addData(), llvm::MCWinCOFFStreamer::EmitCOFFSafeSEH(), llvm::MCWinCOFFStreamer::EmitCOFFSymbolIndex(), llvm::MCObjectStreamer::emitValueToAlignment(), llvm::MipsTargetELFStreamer::finish(), getAlignment(), and llvm::MachObjectWriter::getPaddingSize().
|
inline |
Definition at line 128 of file MCSection.h.
Referenced by llvm::DwarfCompileUnit::addAddrTableBase(), llvm::DwarfUnit::addRnglistsBase(), llvm::DwarfCompileUnit::addScopeRangeList(), llvm::DwarfUnit::addStringOffsetsStart(), llvm::DwarfCompileUnit::applyStmtList(), llvm::MCContext::createELFRelSection(), llvm::DwarfUnit::emitCommonHeader(), llvm::MCObjectFileInfo::getBBAddrMapSection(), getBeginSymbol(), llvm::MCObjectFileInfo::getStackSizesSection(), llvm::DwarfCompileUnit::initStmtList(), and llvm::MCDwarfLineStr::MCDwarfLineStr().
Definition at line 129 of file MCSection.h.
References getBeginSymbol().
|
inline |
Definition at line 148 of file MCSection.h.
Referenced by llvm::MCELFStreamer::emitBundleUnlock().
|
inline |
Definition at line 176 of file MCSection.h.
|
inline |
Definition at line 175 of file MCSection.h.
Definition at line 29 of file MCSection.cpp.
References llvm::MCContext::createTempSymbol().
|
inline |
Definition at line 165 of file MCSection.h.
Referenced by flushPendingLabels(), getFragmentList(), llvm::MCAsmLayout::getSectionAddressSize(), getSubsectionInsertionPoint(), llvm::MCObjectStreamer::insert(), llvm::MCAssembler::layout(), llvm::MCFragment::MCFragment(), llvm::MachObjectWriter::writeAddrsigSection(), and llvm::MachObjectWriter::writeObject().
|
inline |
Definition at line 166 of file MCSection.h.
References getFragmentList().
|
inline |
Definition at line 124 of file MCSection.h.
References Kind.
Referenced by llvm::MCContext::getAssociativeCOFFSection(), llvm::MCSectionXCOFF::printSwitchToSection(), llvm::MCSectionCOFF::useCodeAlign(), and llvm::MCSectionXCOFF::useCodeAlign().
|
inline |
Definition at line 145 of file MCSection.h.
Referenced by llvm::MachObjectWriter::getPaddingSize().
|
inline |
Definition at line 123 of file MCSection.h.
References Name.
Referenced by addData(), llvm::BTFDebug::beginFunctionImpl(), canGoAfterDWARF(), canUseLocalRelocation(), llvm::MCObjectStreamer::emitInstruction(), llvm::MCContext::getAssociativeCOFFSection(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), llvm::MCAsmInfoDarwin::isSectionAtomizableBySymbols(), llvm::MCSectionGOFF::printSwitchToSection(), llvm::MCSectionWasm::printSwitchToSection(), llvm::MCSectionMachO::printSwitchToSection(), llvm::MCSectionCOFF::printSwitchToSection(), llvm::MCSectionELF::printSwitchToSection(), and llvm::MCSectionXCOFF::printSwitchToSection().
|
inline |
Definition at line 142 of file MCSection.h.
|
inlinestatic |
Support for MCFragment::getNextNode().
Definition at line 171 of file MCSection.h.
MCSection::iterator MCSection::getSubsectionInsertionPoint | ( | unsigned | Subsection | ) |
Definition at line 59 of file MCSection.cpp.
References end(), F, getFragmentList(), llvm::iplist_impl< IntrusiveListT, TraitsT >::insert(), llvm::lower_bound(), and MI.
Referenced by flushPendingLabels().
|
inline |
Definition at line 126 of file MCSection.h.
References Variant.
|
virtual |
Reimplemented in llvm::MCSectionELF, and llvm::MCSectionCOFF.
Definition at line 89 of file MCSection.cpp.
Referenced by llvm::MCObjectStreamer::emitInstruction().
bool MCSection::hasEnded | ( | ) | const |
Definition at line 35 of file MCSection.cpp.
References llvm::MCSymbol::isInSection().
|
inline |
Definition at line 159 of file MCSection.h.
Referenced by llvm::MCObjectStreamer::mayHaveInstructions().
|
inline |
Definition at line 152 of file MCSection.h.
Referenced by llvm::MCELFStreamer::emitBundleUnlock().
|
inline |
Definition at line 150 of file MCSection.h.
References NotBundleLocked.
|
inline |
Definition at line 162 of file MCSection.h.
Referenced by llvm::AArch64TargetStreamer::emitNoteSection().
|
pure virtual |
Check whether this section is "virtual", that is has no actual object file contents.
Implemented in llvm::MCSectionXCOFF, llvm::MCSectionELF, llvm::MCSectionCOFF, llvm::MCSectionMachO, llvm::MCSectionWasm, llvm::MCSectionGOFF, and llvm::MCSectionSPIRV.
Referenced by llvm::AsmPrinter::emitGlobalVariable(), llvm::MCObjectStreamer::emitInstruction(), llvm::MachObjectWriter::getPaddingSize(), llvm::MCAsmLayout::getSectionFileSize(), and llvm::MCAssembler::writeSectionData().
|
inline |
Definition at line 140 of file MCSection.h.
Referenced by llvm::MCWinCOFFStreamer::EmitCOFFSafeSEH(), llvm::MCWinCOFFStreamer::EmitCOFFSymbolIndex(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), llvm::MipsTargetELFStreamer::emitMipsAbiFlags(), llvm::MipsRegInfoRecord::EmitMipsOptionRecord(), llvm::DwarfStreamer::emitSwiftAST(), llvm::DwarfStreamer::emitSwiftReflectionSection(), llvm::MCObjectStreamer::emitValueToAlignment(), and llvm::MipsTargetELFStreamer::finish().
|
inline |
Definition at line 132 of file MCSection.h.
References assert().
|
inline |
Definition at line 155 of file MCSection.h.
Referenced by llvm::MCELFStreamer::emitBundleLock().
void MCSection::setBundleLockState | ( | BundleLockStateType | NewState | ) |
Definition at line 39 of file MCSection.cpp.
References BundleLockedAlignToEnd, NotBundleLocked, and llvm::report_fatal_error().
Referenced by llvm::MCELFStreamer::emitBundleLock(), and llvm::MCELFStreamer::emitBundleUnlock().
|
inline |
Definition at line 160 of file MCSection.h.
|
inline |
Definition at line 163 of file MCSection.h.
|
inline |
Definition at line 146 of file MCSection.h.
Referenced by llvm::MCAssembler::layout().
|
inline |
Definition at line 143 of file MCSection.h.
Referenced by llvm::MCAssembler::layout().
|
pure virtual |
Return true if a .align directive should use "optimized nops" to fill instead of 0s.
Implemented in llvm::MCSectionXCOFF, llvm::MCSectionELF, llvm::MCSectionCOFF, llvm::MCSectionMachO, llvm::MCSectionWasm, llvm::MCSectionGOFF, and llvm::MCSectionSPIRV.
Referenced by llvm::MCAssembler::computeFragmentSize().
|
protected |
Definition at line 114 of file MCSection.h.
Referenced by getKind(), and llvm::MCSectionWasm::isWasmData().
|
protected |
Definition at line 112 of file MCSection.h.
Referenced by getName(), llvm::MCSectionCOFF::isImplicitlyDiscardable(), llvm::MCSectionWasm::shouldOmitSectionDirective(), llvm::MCSectionCOFF::shouldOmitSectionDirective(), and llvm::MCSectionELF::shouldOmitSectionDirective().
|
staticconstexpr |
Definition at line 41 of file MCSection.h.
Referenced by llvm::MCContext::createELFGroupSection(), llvm::AsmPrinter::emitPatchableFunctionEntries(), llvm::AsmPrinter::emitXRayTable(), llvm::MCContext::getELFSection(), llvm::TargetLoweringObjectFileELF::getSectionForLSDA(), and llvm::MCSectionELF::isUnique().
|
protected |
Definition at line 113 of file MCSection.h.
Referenced by getVariant().