From: Fangrui Song Date: Sun, 29 Nov 2020 22:01:32 +0000 (-0800) Subject: [ELF] Improve 2 SmallVector<*, N> usage X-Git-Tag: llvmorg-13-init~4912 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfcf1acf13226be0f599a7ab6b395b66dc9545d6;p=platform%2Fupstream%2Fllvm.git [ELF] Improve 2 SmallVector<*, N> usage For --gc-sections, SmallVector -> SmallVector because the code bloat (1296 bytes) is not worthwhile (the saved reallocation is negligible). For OutputSection::compressedData, N=1 is useless (for a compressed .debug_*, the size is always larger than 1). --- diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index 2c350e2..35220e1 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -65,7 +65,7 @@ private: unsigned partition; // A list of sections to visit. - SmallVector queue; + SmallVector queue; // There are normally few input sections whose names are valid C // identifiers, so we just store a std::vector instead of a multimap. diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index d5686f1..39bf48c 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -111,7 +111,7 @@ public: private: // Used for implementation of --compress-debug-sections option. std::vector zDebugHeader; - llvm::SmallVector compressedData; + llvm::SmallVector compressedData; std::array getFiller(); };