From d13a0caf726e05c9bd939d752ef371d6d467ef28 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 12 May 2010 17:56:47 +0000 Subject: MC: Simplify LayoutSection to just take the index of the section to layout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103627 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCAsmLayout.h | 11 ++++++----- include/llvm/MC/MCAssembler.h | 12 ++++-------- 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/llvm/MC/MCAsmLayout.h b/include/llvm/MC/MCAsmLayout.h index bfd177d..c4492a6 100644 --- a/include/llvm/MC/MCAsmLayout.h +++ b/include/llvm/MC/MCAsmLayout.h @@ -50,11 +50,12 @@ public: /// @name Section Access (in layout order) /// @{ - iterator begin() { return SectionOrder.begin(); } - const_iterator begin() const { return SectionOrder.begin(); } - - iterator end() {return SectionOrder.end();} - const_iterator end() const {return SectionOrder.end();} + llvm::SmallVectorImpl &getSectionOrder() { + return SectionOrder; + } + const llvm::SmallVectorImpl &getSectionOrder() const { + return SectionOrder; + } /// @} /// @name Fragment Layout Data diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h index 08500f8..c34c951 100644 --- a/include/llvm/MC/MCAssembler.h +++ b/include/llvm/MC/MCAssembler.h @@ -668,14 +668,10 @@ private: bool FragmentNeedsRelaxation(const MCInstFragment *IF, const MCAsmLayout &Layout) const; - /// LayoutSection - Assign the section the given \arg StartAddress, and then - /// assign offsets and sizes to the fragments in the section \arg SD, and - /// update the section size. - /// - /// \return The address at the end of the section, for use in laying out the - /// succeeding section. - uint64_t LayoutSection(MCSectionData &SD, MCAsmLayout &Layout, - uint64_t StartAddress); + /// LayoutSection - Performs layout of the section referenced by the given + /// \arg SectionOrderIndex. The layout assumes that the previous section has + /// already been layed out correctly. + void LayoutSection(MCAsmLayout &Layout, unsigned SectionOrderIndex); /// LayoutOnce - Perform one layout iteration and return true if any offsets /// were adjusted. -- cgit v1.1