diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-28 17:18:55 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-28 17:18:55 +0000 |
commit | ea4afa91eb453323948588ad1e1706d842fb9007 (patch) | |
tree | ebc6910506ba20fdb7ac4001ac4d5548b6cc92cb /lib/MC/MCELFStreamer.cpp | |
parent | ba210243ef7d325ef6954d459091edf580a241f9 (diff) | |
download | external_llvm-ea4afa91eb453323948588ad1e1706d842fb9007.tar.gz external_llvm-ea4afa91eb453323948588ad1e1706d842fb9007.tar.bz2 external_llvm-ea4afa91eb453323948588ad1e1706d842fb9007.zip |
Fixed verson of r120245.
Factor some duplicated code into MCObjectStreamer::EmitLabel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120248 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCELFStreamer.cpp')
-rw-r--r-- | lib/MC/MCELFStreamer.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp index 2e0d85a1e2..c7ece6f3cb 100644 --- a/lib/MC/MCELFStreamer.cpp +++ b/lib/MC/MCELFStreamer.cpp @@ -191,24 +191,13 @@ void MCELFStreamer::InitSections() { void MCELFStreamer::EmitLabel(MCSymbol *Symbol) { assert(Symbol->isUndefined() && "Cannot define a symbol twice!"); - Symbol->setSection(*CurSection); - - MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); + MCObjectStreamer::EmitLabel(Symbol); const MCSectionELF &Section = static_cast<const MCSectionELF&>(Symbol->getSection()); + MCSymbolData &SD = getAssembler().getSymbolData(*Symbol); if (Section.getFlags() & MCSectionELF::SHF_TLS) SetType(SD, ELF::STT_TLS); - - // FIXME: This is wasteful, we don't necessarily need to create a data - // fragment. Instead, we should mark the symbol as pointing into the data - // fragment if it exists, otherwise we should just queue the label and set its - // fragment pointer when we emit the next fragment. - MCDataFragment *F = getOrCreateDataFragment(); - - assert(!SD.getFragment() && "Unexpected fragment on symbol data!"); - SD.setFragment(F); - SD.setOffset(F->getContents().size()); } void MCELFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) { |