[llvm-commits] [PATCH 1/5] Some ELF sections contain fixed-sized entries. Provide a way to record the entry size of a section.

Matt Fleming matt at console-pimps.org
Mon Jul 26 13:00:19 PDT 2010


---
 include/llvm/MC/MCAssembler.h |    8 ++++++++
 lib/MC/MCAssembler.cpp        |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
index 97ab1a1..51f265d 100644
--- a/include/llvm/MC/MCAssembler.h
+++ b/include/llvm/MC/MCAssembler.h
@@ -366,6 +366,11 @@ private:
   /// Alignment - The maximum alignment seen in this section.
   unsigned Alignment;
 
+  /// EntrySize - The size of each entry in this section. This is ~0
+  /// until initialized. This size only makes sense for sections that
+  /// contain fixed-sized entries.
+  unsigned EntrySize;
+
   /// @name Assembler Backend Data
   /// @{
   //
@@ -391,6 +396,9 @@ public:
   unsigned getAlignment() const { return Alignment; }
   void setAlignment(unsigned Value) { Alignment = Value; }
 
+  unsigned getEntrySize() const { return EntrySize; }
+  void setEntrySize(unsigned Value) { EntrySize = Value; }
+
   bool hasInstructions() const { return HasInstructions; }
   void setHasInstructions(bool Value) { HasInstructions = Value; }
 
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index c1365c1..a284c2e 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -192,6 +192,7 @@ MCSectionData::MCSectionData() : Section(0) {}
 MCSectionData::MCSectionData(const MCSection &_Section, MCAssembler *A)
   : Section(&_Section),
     Alignment(1),
+    EntrySize(~UINT64_C(0)),
     Address(~UINT64_C(0)),
     HasInstructions(false)
 {
-- 
1.6.4.rc0




More information about the llvm-commits mailing list