I will fix the name shortly.
llvm-svn: 238204
/// implementation.
class MCObjectStreamer : public MCStreamer {
MCAssembler *Assembler;
- MCSectionData *CurSectionData;
+ MCSection *CurSectionData;
MCSectionData::iterator CurInsertionPoint;
bool EmitEHFrame;
bool EmitDebugFrame;
void EmitCFISections(bool EH, bool Debug) override;
protected:
- MCSectionData *getCurrentSectionData() const {
- return CurSectionData;
- }
+ MCSection *getCurrentSectionData() const { return CurSectionData; }
MCFragment *getCurrentFragment() const;
void insert(MCFragment *F) {
flushPendingLabels(F);
CurSectionData->getFragmentList().insert(CurInsertionPoint, F);
- F->setParent(&CurSectionData->getSection());
+ F->setParent(CurSectionData);
}
/// Get a data fragment to write into, creating a new one if the current
using namespace llvm;
bool MCELFStreamer::isBundleLocked() const {
- return getCurrentSectionData()->getSection().isBundleLocked();
+ return getCurrentSectionData()->isBundleLocked();
}
MCELFStreamer::~MCELFStreamer() {
void MCELFStreamer::ChangeSection(MCSection *Section,
const MCExpr *Subsection) {
- MCSectionData *CurSectionData = getCurrentSectionData();
- MCSection *CurSection =
- CurSectionData ? &CurSectionData->getSection() : nullptr;
+ MCSection *CurSection = getCurrentSectionData();
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()->getSection();
+ ISD.Section = getCurrentSectionData();
getAssembler().getIndirectSymbols().push_back(ISD);
return true;
}
MCDataFragment *DF;
if (Assembler.isBundlingEnabled()) {
- MCSectionData *SD = getCurrentSectionData();
- MCSection &Sec = SD->getSection();
+ MCSection &Sec = *getCurrentSectionData();
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) {
- MCSectionData *SD = getCurrentSectionData();
- MCSection &Sec = SD->getSection();
+ MCSection &Sec = *getCurrentSectionData();
// Sanity checks
//
}
void MCELFStreamer::EmitBundleUnlock() {
- MCSectionData *SD = getCurrentSectionData();
- MCSection &Sec = SD->getSection();
+ MCSection &Sec = *getCurrentSectionData();
// Sanity checks
if (!getAssembler().isBundlingEnabled())
void MCELFStreamer::FinishImpl() {
// Ensure the last section gets aligned if necessary.
- MCSectionData *CurSectionData = getCurrentSectionData();
- MCSection *CurSection =
- CurSectionData ? &CurSectionData->getSection() : nullptr;
+ MCSection *CurSection = getCurrentSectionData();
setSectionAlignmentForBundling(getAssembler(), CurSection);
EmitFrames(nullptr);
// important for matching the string table that 'as' generates.
IndirectSymbolData ISD;
ISD.Symbol = Symbol;
- ISD.Section = &getCurrentSectionData()->getSection();
+ ISD.Section = getCurrentSectionData();
getAssembler().getIndirectSymbols().push_back(ISD);
return true;
}
if (!F) {
F = new MCDataFragment();
CurSectionData->getFragmentList().insert(CurInsertionPoint, F);
- F->setParent(&CurSectionData->getSection());
+ F->setParent(CurSectionData);
}
for (MCSymbolData *SD : PendingLabels) {
SD->setFragment(F);
flushPendingLabels(nullptr);
bool Created;
- CurSectionData = &getAssembler().getOrCreateSectionData(*Section, &Created);
+ getAssembler().getOrCreateSectionData(*Section, &Created);
+ CurSectionData = Section;
int64_t IntSubsection = 0;
if (Subsection &&
if (IntSubsection < 0 || IntSubsection > 8192)
report_fatal_error("Subsection number out of range");
CurInsertionPoint =
- CurSectionData->getSubsectionInsertionPoint(unsigned(IntSubsection));
+ CurSectionData->getSectionData().getSubsectionInsertionPoint(
+ unsigned(IntSubsection));
return Created;
}
const MCSubtargetInfo &STI) {
MCStreamer::EmitInstruction(Inst, STI);
- MCSectionData *SD = getCurrentSectionData();
- SD->getSection().setHasInstructions(true);
+ MCSection *Sec = getCurrentSectionData();
+ Sec->setHasInstructions(true);
// Now that a machine instruction has been assembled into this section, make
// a line entry for any .loc directive that has been seen.
// group. We want to emit all such instructions into the same data
// fragment.
if (Assembler.getRelaxAll() ||
- (Assembler.isBundlingEnabled() && SD->getSection().isBundleLocked())) {
+ (Assembler.isBundlingEnabled() && Sec->isBundleLocked())) {
MCInst Relaxed;
getAssembler().getBackend().relaxInstruction(Inst, Relaxed);
while (getAssembler().getBackend().mayNeedRelaxation(Relaxed))