aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCAsmLayout.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-12 15:42:59 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-12 15:42:59 +0000
commitbc1a0cf13950dcd64d6d0398df5419a0a2931721 (patch)
tree49b68c3447d927a0fca549dba7f51387b03239d6 /include/llvm/MC/MCAsmLayout.h
parent62d50e89e40cb7fac444bde21bcab10fd69d68e3 (diff)
downloadexternal_llvm-bc1a0cf13950dcd64d6d0398df5419a0a2931721.zip
external_llvm-bc1a0cf13950dcd64d6d0398df5419a0a2931721.tar.gz
external_llvm-bc1a0cf13950dcd64d6d0398df5419a0a2931721.tar.bz2
MC: Track section layout order explicitly, and use to simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCAsmLayout.h')
-rw-r--r--include/llvm/MC/MCAsmLayout.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/include/llvm/MC/MCAsmLayout.h b/include/llvm/MC/MCAsmLayout.h
index ebf0520..bfd177d 100644
--- a/include/llvm/MC/MCAsmLayout.h
+++ b/include/llvm/MC/MCAsmLayout.h
@@ -10,6 +10,8 @@
#ifndef LLVM_MC_MCASMLAYOUT_H
#define LLVM_MC_MCASMLAYOUT_H
+#include "llvm/ADT/SmallVector.h"
+
namespace llvm {
class MCAssembler;
class MCFragment;
@@ -24,11 +26,18 @@ class MCSymbolData;
/// efficiently compute the exact addresses of any symbol in the assembly file,
/// even during the relaxation process.
class MCAsmLayout {
+public:
+ typedef llvm::SmallVectorImpl<MCSectionData*>::const_iterator const_iterator;
+ typedef llvm::SmallVectorImpl<MCSectionData*>::iterator iterator;
+
private:
MCAssembler &Assembler;
+ /// List of sections in layout order.
+ llvm::SmallVector<MCSectionData*, 16> SectionOrder;
+
public:
- MCAsmLayout(MCAssembler &_Assembler) : Assembler(_Assembler) {}
+ MCAsmLayout(MCAssembler &_Assembler);
/// Get the assembler object this is a layout for.
MCAssembler &getAssembler() const { return Assembler; }
@@ -38,6 +47,16 @@ public:
/// the delta from the old size.
void UpdateForSlide(MCFragment *F, int SlideAmount);
+ /// @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();}
+
+ /// @}
/// @name Fragment Layout Data
/// @{