From b3d108b39a55a42621594b5f33fe709cb97a7310 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 10 Mar 2015 21:35:16 +0000 Subject: [PATCH] Move a non-trivial virtual function out of line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231853 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCStreamer.h | 14 +++----------- lib/MC/MCStreamer.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index f0be77f70a7..e65a40e8647 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -344,20 +344,12 @@ public: return true; } - /// SwitchSection - Set the current section where code is being emitted to - /// @p Section. This is required to update CurSection. + /// Set the current section where code is being emitted to @p Section. This + /// is required to update CurSection. /// /// This corresponds to assembler directives like .section, .text, etc. virtual void SwitchSection(const MCSection *Section, - const MCExpr *Subsection = nullptr) { - assert(Section && "Cannot switch to a null section!"); - MCSectionSubPair curSection = SectionStack.back().first; - SectionStack.back().second = curSection; - if (MCSectionSubPair(Section, Subsection) != curSection) { - SectionStack.back().first = MCSectionSubPair(Section, Subsection); - ChangeSection(Section, Subsection); - } - } + const MCExpr *Subsection = nullptr); /// SwitchSectionNoChange - Set the current section where code is being /// emitted to @p Section. This is required to update CurSection. This diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index f11ee669b4b..d5277ffbd10 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -661,3 +661,14 @@ void MCStreamer::EmitBundleAlignMode(unsigned AlignPow2) {} void MCStreamer::EmitBundleLock(bool AlignToEnd) {} void MCStreamer::FinishImpl() {} void MCStreamer::EmitBundleUnlock() {} + +void MCStreamer::SwitchSection(const MCSection *Section, + const MCExpr *Subsection) { + assert(Section && "Cannot switch to a null section!"); + MCSectionSubPair curSection = SectionStack.back().first; + SectionStack.back().second = curSection; + if (MCSectionSubPair(Section, Subsection) != curSection) { + SectionStack.back().first = MCSectionSubPair(Section, Subsection); + ChangeSection(Section, Subsection); + } +} -- 2.34.1