From: Nick Lewycky Date: Thu, 13 Oct 2011 03:30:21 +0000 (+0000) Subject: Elf_Word is not POD! Stop using it in a DenseMap. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f77dea13d7cd803b2e928808612cd0419e3f4122;p=oota-llvm.git Elf_Word is not POD! Stop using it in a DenseMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141851 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Object/ELFObjectFile.cpp b/lib/Object/ELFObjectFile.cpp index 7add2d8a52e..f30d6a03699 100644 --- a/lib/Object/ELFObjectFile.cpp +++ b/lib/Object/ELFObjectFile.cpp @@ -296,7 +296,7 @@ class ELFObjectFile : public ObjectFile { const Elf_Shdr *dot_strtab_sec; // Symbol header string table. Sections_t SymbolTableSections; IndexMap_t SymbolTableSectionsIndexMap; - DenseMap ExtendedSymbolTable; + DenseMap ExtendedSymbolTable; /// @brief Map sections to an array of relocation sections that reference /// them sorted by section index. @@ -375,7 +375,7 @@ public: uint64_t getNumSections() const; uint64_t getStringTableIndex() const; - uint64_t getSymbolTableIndex(const Elf_Sym *symb) const; + ELF::Elf64_Word getSymbolTableIndex(const Elf_Sym *symb) const; const Elf_Shdr *getSection(const Elf_Sym *symb) const; }; } // end namespace @@ -433,7 +433,7 @@ error_code ELFObjectFile } template -uint64_t ELFObjectFile +ELF::Elf64_Word ELFObjectFile ::getSymbolTableIndex(const Elf_Sym *symb) const { if (symb->st_shndx == ELF::SHN_XINDEX) return ExtendedSymbolTable.lookup(symb); @@ -444,11 +444,8 @@ template const typename ELFObjectFile::Elf_Shdr * ELFObjectFile ::getSection(const Elf_Sym *symb) const { - if (symb->st_shndx == ELF::SHN_XINDEX) { - if (!ExtendedSymbolTable.count(symb)) - return 0; + if (symb->st_shndx == ELF::SHN_XINDEX) return getSection(ExtendedSymbolTable.lookup(symb)); - } if (symb->st_shndx >= ELF::SHN_LORESERVE) return 0; return getSection(symb->st_shndx);