diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-02-16 01:08:29 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-02-16 01:08:29 +0000 |
| commit | 58ac6e167722cc6ab187546062a1d23184976835 (patch) | |
| tree | 2e5643c7d5ee0e6fa7b52588c6fea11251e4910e /llvm/lib/MC/MCObjectStreamer.cpp | |
| parent | b5f1e46d30e3e0fa0a2a779b8434279c1715f136 (diff) | |
| download | llvm-58ac6e167722cc6ab187546062a1d23184976835.zip llvm-58ac6e167722cc6ab187546062a1d23184976835.tar.gz llvm-58ac6e167722cc6ab187546062a1d23184976835.tar.bz2 | |
Add support for pushsection and popsection. Patch by Joerg Sonnenberger.
llvm-svn: 125629
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
| -rw-r--r-- | llvm/lib/MC/MCObjectStreamer.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp index ecd7257..0358266 100644 --- a/llvm/lib/MC/MCObjectStreamer.cpp +++ b/llvm/lib/MC/MCObjectStreamer.cpp @@ -101,9 +101,9 @@ void MCObjectStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size, void MCObjectStreamer::EmitLabel(MCSymbol *Symbol) { assert(!Symbol->isVariable() && "Cannot emit a variable symbol!"); - assert(CurSection && "Cannot emit before setting section!"); + assert(getCurrentSection() && "Cannot emit before setting section!"); - Symbol->setSection(*CurSection); + Symbol->setSection(*getCurrentSection()); MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); @@ -142,14 +142,9 @@ void MCObjectStreamer::EmitWeakReference(MCSymbol *Alias, report_fatal_error("This file format doesn't support weak aliases."); } -void MCObjectStreamer::SwitchSection(const MCSection *Section) { +void MCObjectStreamer::ChangeSection(const MCSection *Section) { assert(Section && "Cannot switch to a null section!"); - // If already in this section, then this is a noop. - if (Section == CurSection) return; - - PrevSection = CurSection; - CurSection = Section; CurSectionData = &getAssembler().getOrCreateSectionData(*Section); } |
