From afe5d3d8bebc6266553c5ff96af5334b40fc6ddd Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 12 Sep 2016 00:17:09 +0000 Subject: [PATCH] MC: Move MCSection::begin/end to header, NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281188 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCSection.h | 24 ++++++++---------------- lib/MC/MCSection.cpp | 8 -------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/include/llvm/MC/MCSection.h b/include/llvm/MC/MCSection.h index 7996aea63846..d4c31696b40f 100644 --- a/include/llvm/MC/MCSection.h +++ b/include/llvm/MC/MCSection.h @@ -153,25 +153,17 @@ class MCSection { const MCDummyFragment &getDummyFragment() const { return DummyFragment; } MCDummyFragment &getDummyFragment() { return DummyFragment; } - MCSection::iterator begin(); - MCSection::const_iterator begin() const { - return const_cast(this)->begin(); - } + iterator begin() { return Fragments.begin(); } + const_iterator begin() const { return Fragments.begin(); } - MCSection::iterator end(); - MCSection::const_iterator end() const { - return const_cast(this)->end(); - } + iterator end() { return Fragments.end(); } + const_iterator end() const { return Fragments.end(); } - MCSection::reverse_iterator rbegin(); - MCSection::const_reverse_iterator rbegin() const { - return const_cast(this)->rbegin(); - } + reverse_iterator rbegin() { return Fragments.rbegin(); } + const_reverse_iterator rbegin() const { return Fragments.rbegin(); } - MCSection::reverse_iterator rend(); - MCSection::const_reverse_iterator rend() const { - return const_cast(this)->rend(); - } + reverse_iterator rend() { return Fragments.rend(); } + const_reverse_iterator rend() const { return Fragments.rend(); } MCSection::iterator getSubsectionInsertionPoint(unsigned Subsection); diff --git a/lib/MC/MCSection.cpp b/lib/MC/MCSection.cpp index c5e4077a306e..9064cdf2f319 100644 --- a/lib/MC/MCSection.cpp +++ b/lib/MC/MCSection.cpp @@ -97,11 +97,3 @@ LLVM_DUMP_METHOD void MCSection::dump() { } OS << "]>"; } - -MCSection::iterator MCSection::begin() { return Fragments.begin(); } - -MCSection::iterator MCSection::end() { return Fragments.end(); } - -MCSection::reverse_iterator MCSection::rbegin() { return Fragments.rbegin(); } - -MCSection::reverse_iterator MCSection::rend() { return Fragments.rend(); }