void EmitCFISections(bool EH, bool Debug) override;
protected:
- MCSection *getCurrentSectionData() const { return getCurrentSection().first; }
-
MCFragment *getCurrentFragment() const;
void insert(MCFragment *F) {
flushPendingLabels(F);
- MCSection *CurSection = getCurrentSectionData();
+ MCSection *CurSection = getCurrentSectionOnly();
CurSection->getFragmentList().insert(CurInsertionPoint, F);
F->setParent(CurSection);
}
return SectionStack.back().first;
return MCSectionSubPair();
}
+ MCSection *getCurrentSectionOnly() const { return getCurrentSection().first; }
/// \brief Return the previous section that the streamer is emitting code to.
MCSectionSubPair getPreviousSection() const {
using namespace llvm;
bool MCELFStreamer::isBundleLocked() const {
- return getCurrentSectionData()->isBundleLocked();
+ return getCurrentSectionOnly()->isBundleLocked();
}
MCELFStreamer::~MCELFStreamer() {
void MCELFStreamer::ChangeSection(MCSection *Section,
const MCExpr *Subsection) {
- MCSection *CurSection = getCurrentSectionData();
+ MCSection *CurSection = getCurrentSectionOnly();
if (CurSection && isBundleLocked())
report_fatal_error("Unterminated .bundle_lock when changing a section");
// important for matching the string table that 'as' generates.
IndirectSymbolData ISD;
ISD.Symbol = Symbol;
- ISD.Section = getCurrentSectionData();
+ ISD.Section = getCurrentSectionOnly();
getAssembler().getIndirectSymbols().push_back(ISD);
return true;
}
MCDataFragment *DF;
if (Assembler.isBundlingEnabled()) {
- MCSection &Sec = *getCurrentSectionData();
+ MCSection &Sec = *getCurrentSectionOnly();
if (Assembler.getRelaxAll() && isBundleLocked())
// If the -mc-relax-all flag is used and we are bundle-locked, we re-use
// the current bundle group.
}
void MCELFStreamer::EmitBundleLock(bool AlignToEnd) {
- MCSection &Sec = *getCurrentSectionData();
+ MCSection &Sec = *getCurrentSectionOnly();
// Sanity checks
//
}
void MCELFStreamer::EmitBundleUnlock() {
- MCSection &Sec = *getCurrentSectionData();
+ MCSection &Sec = *getCurrentSectionOnly();
// Sanity checks
if (!getAssembler().isBundlingEnabled())
void MCELFStreamer::FinishImpl() {
// Ensure the last section gets aligned if necessary.
- MCSection *CurSection = getCurrentSectionData();
+ MCSection *CurSection = getCurrentSectionOnly();
setSectionAlignmentForBundling(getAssembler(), CurSection);
EmitFrames(nullptr);
// important for matching the string table that 'as' generates.
IndirectSymbolData ISD;
ISD.Symbol = Symbol;
- ISD.Section = getCurrentSectionData();
+ ISD.Section = getCurrentSectionOnly();
getAssembler().getIndirectSymbols().push_back(ISD);
return true;
}
if (PendingLabels.size()) {
if (!F) {
F = new MCDataFragment();
- MCSection *CurSection = getCurrentSectionData();
+ MCSection *CurSection = getCurrentSectionOnly();
CurSection->getFragmentList().insert(CurInsertionPoint, F);
F->setParent(CurSection);
}
}
MCFragment *MCObjectStreamer::getCurrentFragment() const {
- assert(getCurrentSectionData() && "No current section!");
+ assert(getCurrentSectionOnly() && "No current section!");
- if (CurInsertionPoint != getCurrentSectionData()->getFragmentList().begin())
+ if (CurInsertionPoint != getCurrentSectionOnly()->getFragmentList().begin())
return std::prev(CurInsertionPoint);
return nullptr;
const MCSubtargetInfo &STI) {
MCStreamer::EmitInstruction(Inst, STI);
- MCSection *Sec = getCurrentSectionData();
+ MCSection *Sec = getCurrentSectionOnly();
Sec->setHasInstructions(true);
// Now that a machine instruction has been assembled into this section, make