[ELF][Writer] Let std::vector handle allocating space instead of reserving tiny portions.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Wed, 13 Mar 2013 00:30:08 +0000 (00:30 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Wed, 13 Mar 2013 00:30:08 +0000 (00:30 +0000)
llvm-svn: 176916

lld/lib/ReaderWriter/ELF/File.h

index e59fe95..c6bf131 100644 (file)
@@ -575,12 +575,6 @@ private:
     // Add Rela (those with r_addend) references:
     auto rari = _relocationAddendRefences.find(sectionName);
     auto rri = _relocationReferences.find(sectionName);
-    unsigned refs = 0;
-    if (rari != _relocationAddendRefences.end())
-      refs += rari->second.size();
-    if (rri != _relocationReferences.end())
-      refs += rri->second.size();
-    _references.reserve(_references.size() + refs);
     if (rari != _relocationAddendRefences.end())
       for (auto &rai : rari->second) {
         if (!((rai->r_offset >= symbol->st_value) &&