From b54d29735af9ddabce268c817ccc2ab3eb54d719 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2013 18:18:36 +0000 Subject: MCObjectSymbolizer: Switch from IntervalMap to sorted vector, following r182625. This removes the need for the missing SectionRef operator< workaround, and fixes an IntervalMap assert about alignment on MSVC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182949 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCObjectSymbolizer.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'include/llvm/MC/MCObjectSymbolizer.h') diff --git a/include/llvm/MC/MCObjectSymbolizer.h b/include/llvm/MC/MCObjectSymbolizer.h index 0e3a17b8f7..555cf5195d 100644 --- a/include/llvm/MC/MCObjectSymbolizer.h +++ b/include/llvm/MC/MCObjectSymbolizer.h @@ -15,10 +15,10 @@ #ifndef LLVM_MC_MCOBJECTSYMBOLIZER_H #define LLVM_MC_MCOBJECTSYMBOLIZER_H -#include "llvm/ADT/IntervalMap.h" #include "llvm/ADT/DenseMap.h" #include "llvm/MC/MCSymbolizer.h" #include "llvm/Object/ObjectFile.h" +#include namespace llvm { @@ -33,12 +33,8 @@ protected: const object::ObjectFile *Obj; typedef DenseMap AddrToRelocMap; - // FIXME: Working around a missing SectionRef operator!= by storing - // DataRefImpl.p instead of SectionRef. Feel free to improve! - typedef IntervalMap AddrToSectionMap; - - AddrToSectionMap::Allocator AddrToSectionAllocator; - AddrToSectionMap AddrToSection; + typedef std::vector SortedSectionList; + SortedSectionList SortedSections; // Map a load address to the first relocation that applies there. As far as I // know, if there are several relocations at the exact same address, they are @@ -48,6 +44,11 @@ protected: // relocation (referencing the subtrahend symbol). AddrToRelocMap AddrToReloc; + // Helpers around SortedSections. + SortedSectionList::const_iterator findSectionContaining(uint64_t Addr) const; + void insertSection(object::SectionRef Section); + + MCObjectSymbolizer(MCContext &Ctx, OwningPtr &RelInfo, const object::ObjectFile *Obj); -- cgit v1.2.3