From f8803fe4177739f9a6900198f601808eb27934d9 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 6 Dec 2010 03:48:09 +0000 Subject: [PATCH] Remove the getAddress getter, initialize Ordinal in the constructor and use 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 | 2 -- lib/MC/ELFObjectWriter.cpp | 2 +- lib/MC/MCAssembler.cpp | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h index 0fb3a8ce2d0..16c527ffc16 100644 --- a/include/llvm/MC/MCAssembler.h +++ b/include/llvm/MC/MCAssembler.h @@ -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 /// @{ diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 1fc844cc4a2..bd6c5f85499 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -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(); } diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index c4e775e2c94..ac0f31f79eb 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -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)