Refactor GdbIndexSection. NFC.
authorRui Ueyama <ruiu@google.com>
Tue, 10 Jul 2018 23:48:27 +0000 (23:48 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 10 Jul 2018 23:48:27 +0000 (23:48 +0000)
commitf3731d4e9c7d8201c27992d8990efaeaa7297b4c
treec901e7b0eccd088ca826d420caaa911b6088dd1d
parentd2c739230ced8e1557c67bc661e91cf807be0a32
Refactor GdbIndexSection. NFC.

This patch merges createGdbIndex function and GdbIndexSection's
constructor into a single static member function of the class.

This patch also change how we keep CU vectors. Previously, CuVector
and GdbSymbols were parallel arrays, but there's no reason to choose that
design. Now, CuVector is a member of GdbSymbol class.

A lot of members are removed from GdbIndexSection. Previously, it has
members that need to be kept in sync over several phases. I belive the new
design is less error-prone, and the new code is much easier to read
than before.

llvm-svn: 336743
lld/ELF/SyntheticSections.cpp
lld/ELF/SyntheticSections.h
lld/ELF/Writer.cpp