LLVM 18.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 , SV_DXContainer } |
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(). | |
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 63 of file MCSection.h.
Definition at line 66 of file MCSection.h.
Definition at line 61 of file MCSection.h.
Definition at line 64 of file MCSection.h.
Definition at line 67 of file MCSection.h.
Express the state of bundle locked groups while emitting code.
Enumerator | |
---|---|
NotBundleLocked | |
BundleLocked | |
BundleLockedAlignToEnd |
Definition at line 55 of file MCSection.h.
Enumerator | |
---|---|
SV_COFF | |
SV_ELF | |
SV_GOFF | |
SV_MachO | |
SV_Wasm | |
SV_XCOFF | |
SV_SPIRV | |
SV_DXContainer |
Definition at line 43 of file MCSection.h.
|
protected |
Definition at line 23 of file MCSection.cpp.
|
protecteddefault |
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.
References llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::MCObjectStreamer::addPendingLabel(), and llvm::MCObjectStreamer::flushPendingLabels().
|
inline |
Definition at line 185 of file MCSection.h.
Referenced by llvm::MCAsmLayout::canGetFragmentOffset(), dump(), EmitUnwindCode(), flushPendingLabels(), and llvm::MCAssembler::layout().
|
inline |
Definition at line 186 of file MCSection.h.
LLVM_DUMP_METHOD void MCSection::dump | ( | ) | const |
Definition at line 128 of file MCSection.cpp.
References begin(), end(), llvm::errs(), and OS.
|
inline |
Definition at line 188 of file MCSection.h.
Referenced by AttemptToFoldSymbolOffsetDifference(), dump(), and getSubsectionInsertionPoint().
|
inline |
Definition at line 189 of file MCSection.h.
|
inline |
Makes sure that Alignment is at least MinAlignment.
Definition at line 144 of file MCSection.h.
Referenced by llvm::MCWinCOFFStreamer::emitCOFFSafeSEH(), llvm::MCWinCOFFStreamer::emitCOFFSymbolIndex(), llvm::MCObjectStreamer::emitValueToAlignment(), and llvm::MipsTargetELFStreamer::finish().
void MCSection::flushPendingLabels | ( | ) |
Associate all pending labels with empty data fragments.
One fragment will be created for each subsection as necessary.
Definition at line 109 of file MCSection.cpp.
References begin(), llvm::SmallVectorBase< Size_T >::empty(), F, flushPendingLabels(), getFragmentList(), getSubsectionInsertionPoint(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::insert().
Referenced by flushPendingLabels().
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::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::SmallVectorImpl< T >::erase(), and F.
Referenced by llvm::MCObjectStreamer::flushPendingLabels().
|
inline |
Definition at line 140 of file MCSection.h.
Referenced by addData(), getAlignment(), and llvm::MachObjectWriter::getPaddingSize().
|
inline |
Definition at line 129 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::getKCFITrapSection(), llvm::MCObjectFileInfo::getPCSection(), llvm::MCObjectFileInfo::getPseudoProbeSection(), llvm::MCObjectFileInfo::getStackSizesSection(), llvm::DwarfCompileUnit::initStmtList(), and llvm::MCDwarfLineStr::MCDwarfLineStr().
Definition at line 130 of file MCSection.h.
References getBeginSymbol().
|
inline |
Definition at line 155 of file MCSection.h.
Referenced by llvm::MCELFStreamer::emitBundleUnlock().
|
inline |
Definition at line 183 of file MCSection.h.
|
inline |
Definition at line 182 of file MCSection.h.
Definition at line 29 of file MCSection.cpp.
References llvm::MCContext::createTempSymbol().
|
inline |
Definition at line 172 of file MCSection.h.
Referenced by flushPendingLabels(), getFragmentList(), llvm::MCAsmLayout::getSectionAddressSize(), getSubsectionInsertionPoint(), llvm::MCObjectStreamer::insert(), llvm::MCAssembler::layout(), llvm::MCFragment::MCFragment(), and llvm::MachObjectWriter::writeObject().
|
inline |
Definition at line 173 of file MCSection.h.
References getFragmentList().
|
inline |
Definition at line 125 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 152 of file MCSection.h.
Referenced by llvm::MachObjectWriter::getPaddingSize().
|
inline |
Definition at line 124 of file MCSection.h.
References Name.
Referenced by addData(), llvm::BTFDebug::beginFunctionImpl(), canGoAfterDWARF(), canUseLocalRelocation(), llvm::MCObjectStreamer::emitInstruction(), llvm::MCContext::getAssociativeCOFFSection(), llvm::MCObjectFileInfo::getPseudoProbeSection(), llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(), isDwoSection(), llvm::MCAsmInfoDarwin::isSectionAtomizableBySymbols(), llvm::MCSectionCOFF::printSwitchToSection(), llvm::MCSectionELF::printSwitchToSection(), llvm::MCSectionGOFF::printSwitchToSection(), llvm::MCSectionMachO::printSwitchToSection(), llvm::MCSectionWasm::printSwitchToSection(), and llvm::MCSectionXCOFF::printSwitchToSection().
|
inline |
Definition at line 149 of file MCSection.h.
|
inlinestatic |
Support for MCFragment::getNextNode().
Definition at line 178 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 127 of file MCSection.h.
References Variant.
Referenced by llvm::MCSectionCOFF::classof(), llvm::MCSectionELF::classof(), llvm::MCSectionGOFF::classof(), llvm::MCSectionMachO::classof(), llvm::MCSectionWasm::classof(), and llvm::MCSectionXCOFF::classof().
|
virtual |
Reimplemented in llvm::MCSectionCOFF, and llvm::MCSectionELF.
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 166 of file MCSection.h.
Referenced by AttemptToFoldSymbolOffsetDifference(), and llvm::MCObjectStreamer::mayHaveInstructions().
|
inline |
Definition at line 159 of file MCSection.h.
Referenced by llvm::MCELFStreamer::emitBundleUnlock().
|
inline |
Definition at line 157 of file MCSection.h.
References NotBundleLocked.
|
inline |
Definition at line 169 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::MCSectionCOFF, llvm::MCSectionDXContainer, llvm::MCSectionELF, llvm::MCSectionGOFF, llvm::MCSectionMachO, llvm::MCSectionSPIRV, llvm::MCSectionWasm, and llvm::MCSectionXCOFF.
Referenced by llvm::AsmPrinter::emitGlobalVariable(), llvm::MCObjectStreamer::emitInstruction(), llvm::MachObjectWriter::getPaddingSize(), llvm::MCAsmLayout::getSectionFileSize(), and llvm::MCAssembler::writeSectionData().
|
inline |
Definition at line 141 of file MCSection.h.
Referenced by llvm::MipsTargetELFStreamer::emitDirectiveEnd(), llvm::MipsTargetELFStreamer::emitMipsAbiFlags(), llvm::MipsRegInfoRecord::EmitMipsOptionRecord(), llvm::DwarfStreamer::emitSwiftAST(), llvm::dwarflinker_parallel::DwarfEmitterImpl::emitSwiftAST(), llvm::DwarfStreamer::emitSwiftReflectionSection(), and llvm::dwarflinker_parallel::DwarfEmitterImpl::emitSwiftReflectionSection().
|
inline |
Definition at line 133 of file MCSection.h.
|
inline |
Definition at line 162 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 167 of file MCSection.h.
|
inline |
Definition at line 170 of file MCSection.h.
|
inline |
Definition at line 153 of file MCSection.h.
Referenced by llvm::MCAssembler::layout().
|
inline |
Definition at line 150 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::MCSectionCOFF, llvm::MCSectionDXContainer, llvm::MCSectionELF, llvm::MCSectionGOFF, llvm::MCSectionMachO, llvm::MCSectionSPIRV, llvm::MCSectionWasm, and llvm::MCSectionXCOFF.
Referenced by llvm::MCAssembler::computeFragmentSize().
|
protected |
Definition at line 115 of file MCSection.h.
Referenced by getKind(), and llvm::MCSectionWasm::isWasmData().
|
protected |
Definition at line 113 of file MCSection.h.
Referenced by getName(), llvm::MCSectionCOFF::isImplicitlyDiscardable(), llvm::MCSectionCOFF::shouldOmitSectionDirective(), llvm::MCSectionELF::shouldOmitSectionDirective(), and llvm::MCSectionWasm::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 114 of file MCSection.h.
Referenced by getVariant().