diff --git a/include/llvm/MC/MCObjectStreamer.h b/include/llvm/MC/MCObjectStreamer.h index 437e09af6b8..4cc93c95ef6 100644 --- a/include/llvm/MC/MCObjectStreamer.h +++ b/include/llvm/MC/MCObjectStreamer.h @@ -38,7 +38,7 @@ class MCObjectStreamer : public MCStreamer { MCSection::iterator CurInsertionPoint; bool EmitEHFrame; bool EmitDebugFrame; - SmallVector PendingLabels; + SmallVector PendingLabels; virtual void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo&) = 0; void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) override; diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp index 6ec4e2d8855..88cced6c2f5 100644 --- a/lib/MC/MCObjectStreamer.cpp +++ b/lib/MC/MCObjectStreamer.cpp @@ -46,7 +46,8 @@ void MCObjectStreamer::flushPendingLabels(MCFragment *F, uint64_t FOffset) { CurSection->getFragmentList().insert(CurInsertionPoint, F); F->setParent(CurSection); } - for (MCSymbolData *SD : PendingLabels) { + for (MCSymbol *Sym : PendingLabels) { + MCSymbolData *SD = &Sym->getData(); SD->setFragment(F); SD->setOffset(FOffset); } @@ -174,7 +175,7 @@ void MCObjectStreamer::EmitLabel(MCSymbol *Symbol) { SD.setFragment(F); SD.setOffset(F->getContents().size()); } else { - PendingLabels.push_back(&SD); + PendingLabels.push_back(Symbol); } }