diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-04-30 16:25:02 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-04-30 16:25:02 +0000 |
commit | a8febf2283921157da1539c079cd74a55bf89a5a (patch) | |
tree | 9d35112077dfea406ecb273ab0ea1ee2e99292e1 /tools/yaml2obj/yaml2elf.cpp | |
parent | b1c1b8a78dce82d3740316ddf94029696ba68674 (diff) | |
download | llvm-a8febf2283921157da1539c079cd74a55bf89a5a.tar.gz llvm-a8febf2283921157da1539c079cd74a55bf89a5a.tar.bz2 llvm-a8febf2283921157da1539c079cd74a55bf89a5a.tar.xz |
ELFObjectWriter: deduplicate suffices in strtab
We already do this for shstrtab, so might as well do it for strtab. This
extracts the string table building code into a separate class. The idea
is to use it for other object formats too.
I mostly wanted to do this for the general principle, but it does save a
little bit on object file size. I tried this on a clang bootstrap and
saved 0.54% on the sum of object file sizes (1.14 MB out of 212 MB for
a release build).
Differential Revision: http://reviews.llvm.org/D3533
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207670 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/yaml2obj/yaml2elf.cpp')
-rw-r--r-- | tools/yaml2obj/yaml2elf.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/yaml2obj/yaml2elf.cpp b/tools/yaml2obj/yaml2elf.cpp index acbac9c605..c78e1dbe77 100644 --- a/tools/yaml2obj/yaml2elf.cpp +++ b/tools/yaml2obj/yaml2elf.cpp @@ -30,10 +30,8 @@ using namespace llvm; // This class has a deliberately small interface, since a lot of // implementation variation is possible. // -// TODO: Use an ordered container with a suffix-based comparison in order -// to deduplicate suffixes. std::map<> with a custom comparator is likely -// to be the simplest implementation, but a suffix trie could be more -// suitable for the job. +// TODO: Use the StringTable builder from lib/Object instead, since it +// will deduplicate suffixes. namespace { class StringTableBuilder { /// \brief Indices of strings currently present in `Buf`. |