[lld] Fix a bug where we continually re-follow type servers.
authorZachary Turner <zturner@google.com>
Thu, 25 May 2017 21:16:03 +0000 (21:16 +0000)
committerZachary Turner <zturner@google.com>
Thu, 25 May 2017 21:16:03 +0000 (21:16 +0000)
commit2897e0306efe62703bad8e1234334fefccf2ae37
tree3add1a80055e691aec5a729dc9d9599c0cd50fef
parent7f97c362a4640d2ce8481b091b8f5df495b13fda
[lld] Fix a bug where we continually re-follow type servers.

Originally this was intended to be set up so that when linking
a PDB which refers to a type server, it would only visit the
PDB once, and on subsequent visitations it would just skip it
since all the records had already been added.

Due to some C++ scoping issues, this was not occurring and it
was revisiting the type server every time, which caused every
record to end up being thrown away on all subsequent visitations.

This doesn't affect the performance of linking clang-cl generated
object files because we don't use type servers, but when linking
object files and libraries generated with /Zi via MSVC, this means
only 1 object file has to be linked instead of N object files, so
the speedup is quite large.

llvm-svn: 303920
lld/COFF/PDB.cpp
llvm/include/llvm/DebugInfo/PDB/Native/PDBTypeServerHandler.h
llvm/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp