[lld] r232864 - [ELF] Use unordered_map for AdditionalSegments

Shankar Easwaran shankare at codeaurora.org
Fri Mar 20 16:47:00 PDT 2015


Author: shankare
Date: Fri Mar 20 18:47:00 2015
New Revision: 232864

URL: http://llvm.org/viewvc/llvm-project?rev=232864&view=rev
Log:
[ELF] Use unordered_map for AdditionalSegments

Fix a leftover class during implementation.

Modified:
    lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h

Modified: lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h?rev=232864&r1=232863&r2=232864&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h Fri Mar 20 18:47:00 2015
@@ -139,10 +139,10 @@ public:
 
   class AdditionalSegmentHashKey {
   public:
-    int64_t operator() (int64_t segmentType, int64_t segmentFlag) const {
+    int64_t operator()(const AdditionalSegmentKey &k) const {
       // k.first = SegmentName
       // k.second = SegmentFlags
-      return llvm::hash_combine(segmentType, segmentFlag);
+      return llvm::hash_combine(k.first, k.second);
     }
   };
 
@@ -154,7 +154,8 @@ public:
 
   typedef std::unordered_map<SectionKey, AtomSection<ELFT> *, SectionKeyHash,
                              SectionKeyEq> SectionMapT;
-  typedef std::map<AdditionalSegmentKey, Segment<ELFT> *> AdditionalSegmentMapT;
+  typedef std::unordered_map<AdditionalSegmentKey, Segment<ELFT> *,
+                             AdditionalSegmentHashKey> AdditionalSegmentMapT;
   typedef std::unordered_map<SegmentKey, Segment<ELFT> *, SegmentHashKey>
   SegmentMapT;
 





More information about the llvm-commits mailing list