[llvm] r237816 - MC: Use MCSymbol in LocalCommon, NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Wed May 20 11:25:40 PDT 2015
Author: dexonsmith
Date: Wed May 20 13:25:40 2015
New Revision: 237816
URL: http://llvm.org/viewvc/llvm-project?rev=237816&view=rev
Log:
MC: Use MCSymbol in LocalCommon, NFC
Switch from MCSymbolData to MCSymbol in LocalCommon.
Modified:
llvm/trunk/include/llvm/MC/MCELFStreamer.h
llvm/trunk/lib/MC/MCELFStreamer.cpp
Modified: llvm/trunk/include/llvm/MC/MCELFStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCELFStreamer.h?rev=237816&r1=237815&r2=237816&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCELFStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCELFStreamer.h Wed May 20 13:25:40 2015
@@ -101,7 +101,7 @@ private:
bool SeenIdent;
struct LocalCommon {
- MCSymbolData *SD;
+ const MCSymbol *Symbol;
uint64_t Size;
unsigned ByteAlignment;
};
Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=237816&r1=237815&r2=237816&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCELFStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCELFStreamer.cpp Wed May 20 13:25:40 2015
@@ -319,7 +319,7 @@ void MCELFStreamer::EmitCommonSymbol(MCS
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<LocalCommon>::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())
More information about the llvm-commits
mailing list