diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2013-05-30 18:18:36 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2013-05-30 18:18:36 +0000 |
commit | b54d29735af9ddabce268c817ccc2ab3eb54d719 (patch) | |
tree | 68438b743f0a13e3ce1ef8c96028f90ff9cb84e1 /include | |
parent | 964722ca40f48c65605e459e3a732bb8783b92f6 (diff) | |
download | external_llvm-b54d29735af9ddabce268c817ccc2ab3eb54d719.zip external_llvm-b54d29735af9ddabce268c817ccc2ab3eb54d719.tar.gz external_llvm-b54d29735af9ddabce268c817ccc2ab3eb54d719.tar.bz2 |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCObjectSymbolizer.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/include/llvm/MC/MCObjectSymbolizer.h b/include/llvm/MC/MCObjectSymbolizer.h index 0e3a17b..555cf51 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 <vector> namespace llvm { @@ -33,12 +33,8 @@ protected: const object::ObjectFile *Obj; typedef DenseMap<uint64_t, object::RelocationRef> AddrToRelocMap; - // FIXME: Working around a missing SectionRef operator!= by storing - // DataRefImpl.p instead of SectionRef. Feel free to improve! - typedef IntervalMap<uint64_t, uintptr_t> AddrToSectionMap; - - AddrToSectionMap::Allocator AddrToSectionAllocator; - AddrToSectionMap AddrToSection; + typedef std::vector<object::SectionRef> 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<MCRelocationInfo> &RelInfo, const object::ObjectFile *Obj); |