Pass -gcodeview-ghash when using clang-cl and lld-link
authorReid Kleckner <rnk@google.com>
Thu, 27 May 2021 21:32:48 +0000 (14:32 -0700)
committerReid Kleckner <rnk@google.com>
Fri, 28 May 2021 03:49:17 +0000 (20:49 -0700)
commitef4cfd83223890fdbd69fbc9899089365f4588b4
treef53f1f6855224eb16065ec0e56f69ae9dd1f6bee
parent59b8afe50274be975c62a4b11db49c84a874c0c0
Pass -gcodeview-ghash when using clang-cl and lld-link

This precomputes some hashes that LLD uses for type merging to speed up
linking when PDBs are enabled. Only do this if any kind of /DEBUG flag
is passed to the linker. -gcodeview-ghash is orthogonal to /Z7, -g, -g1,
or -gmlt, so it is safe to set it independently from those flags. It
will not increase debug info emission.

Differential Revision: https://reviews.llvm.org/D103287
llvm/cmake/modules/HandleLLVMOptions.cmake