From 80b2cb6d4d26d4b7c89f15fd188fa8071fb421a4 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 20 May 2015 18:25:40 +0000 Subject: [PATCH] MC: Use MCSymbol in LocalCommon, NFC Switch from MCSymbolData to MCSymbol in LocalCommon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237816 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCELFStreamer.h | 2 +- lib/MC/MCELFStreamer.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/llvm/MC/MCELFStreamer.h b/include/llvm/MC/MCELFStreamer.h index d4df5fcb9eb..bdd59cf6047 100644 --- a/include/llvm/MC/MCELFStreamer.h +++ b/include/llvm/MC/MCELFStreamer.h @@ -101,7 +101,7 @@ private: bool SeenIdent; struct LocalCommon { - MCSymbolData *SD; + const MCSymbol *Symbol; uint64_t Size; unsigned ByteAlignment; }; diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp index 0286fd5aefd..fe54dcbd83c 100644 --- a/lib/MC/MCELFStreamer.cpp +++ b/lib/MC/MCELFStreamer.cpp @@ -319,7 +319,7 @@ void MCELFStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, AssignSection(Symbol, Section); - struct LocalCommon L = {&SD, Size, ByteAlignment}; + struct LocalCommon L = {Symbol, Size, ByteAlignment}; LocalCommons.push_back(L); } else { SD.setCommon(Size, ByteAlignment); @@ -630,17 +630,16 @@ void MCELFStreamer::Flush() { for (std::vector::const_iterator i = LocalCommons.begin(), e = LocalCommons.end(); i != e; ++i) { - MCSymbolData *SD = i->SD; + const MCSymbol &Symbol = *i->Symbol; uint64_t Size = i->Size; unsigned ByteAlignment = i->ByteAlignment; - const MCSymbol &Symbol = SD->getSymbol(); const MCSection &Section = Symbol.getSection(); MCSectionData &SectData = getAssembler().getOrCreateSectionData(Section); new MCAlignFragment(ByteAlignment, 0, 1, ByteAlignment, &SectData); MCFragment *F = new MCFillFragment(0, 0, Size, &SectData); - SD->setFragment(F); + Symbol.getData().setFragment(F); // Update the maximum alignment of the section if necessary. if (ByteAlignment > SectData.getAlignment())