Speeds up CU vector creation.
authorRui Ueyama <ruiu@google.com>
Mon, 25 Sep 2017 04:55:27 +0000 (04:55 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 25 Sep 2017 04:55:27 +0000 (04:55 +0000)
commit17cc6f6ad9787994b95c4ae56dffe4f18c1dfb91
tree509f7ccea8bced82f54f8942e0523f85358f87d7
parent8f222b815883a5cbee7338697ae53cea98b1ce2e
Speeds up CU vector creation.

We used to use std::set to uniquify CU vector elements, but as we know,
std::set is pretty slow. Fortunately we didn't actually have to use a
std::set here. This patch replaces it with std::vector.

With this patch, lld's -gdb-index overhead when linking a clang debug
build is now about 1 second (8.65 seconds without -gdb-index vs 9.60
seconds with -gdb-index). Since gold takes more than 6 seconds to create
a .gdb_index for the same output, our number isn't that bad.

llvm-svn: 314094
lld/ELF/SyntheticSections.cpp
lld/ELF/SyntheticSections.h