Remove the getAddress getter, initialize Ordinal in the constructor and use
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 6 Dec 2010 03:48:09 +0000 (03:48 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 6 Dec 2010 03:48:09 +0000 (03:48 +0000)
that on the ELF writer to detect a section we created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120981 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCAssembler.h
lib/MC/ELFObjectWriter.cpp
lib/MC/MCAssembler.cpp

index 0fb3a8ce2d075de56efe5308dca39bc168ff5c1e..16c527ffc16a701de4f28de282f8a37801a2db8c 100644 (file)
@@ -476,8 +476,6 @@ public:
   unsigned getLayoutOrder() const { return LayoutOrder; }
   void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
 
-  uint64_t getAddress() const { return Address; }
-
   /// @name Fragment Access
   /// @{
 
index 1fc844cc4a2dd286057058e1bd858eecf84e0207..bd6c5f85499a71196ba2de55f9b6b946511a2638 100644 (file)
@@ -1285,7 +1285,7 @@ void ELFObjectWriter::WriteSection(MCAssembler &Asm,
 }
 
 static bool IsELFMetaDataSection(const MCSectionData &SD) {
-  return SD.getAddress() == ~UINT64_C(0) &&
+  return SD.getOrdinal() == ~UINT32_C(0) &&
     !SD.getSection().isVirtualSection();
 }
 
index c4e775e2c94773f76b83981570366adcf6801026..ac0f31f79eba053c98a403e339e64600bb98b1cb 100644 (file)
@@ -218,6 +218,7 @@ MCSectionData::MCSectionData() : Section(0) {}
 
 MCSectionData::MCSectionData(const MCSection &_Section, MCAssembler *A)
   : Section(&_Section),
+    Ordinal(~UINT32_C(0)),
     Alignment(1),
     Address(~UINT64_C(0)),
     HasInstructions(false)