This is an archive of the discontinued LLVM Phabricator instance.

Pass -gcodeview-ghash when using clang-cl and lld-link
ClosedPublic

Authored by rnk on May 27 2021, 2:35 PM.

Details

Summary

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.

Diff Detail

Event Timeline

rnk created this revision.May 27 2021, 2:35 PM
rnk requested review of this revision.May 27 2021, 2:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2021, 2:35 PM
aganea added inline comments.May 27 2021, 5:00 PM
llvm/cmake/modules/HandleLLVMOptions.cmake
490

Do we need prior testing of the Clang version? I believe this won't work if using Clang 10 or before as a bootstrap compiler?

rnk updated this revision to Diff 348436.May 27 2021, 8:06 PM
  • do the feature check
aganea accepted this revision.May 27 2021, 8:24 PM

Great, LGTM! Thanks Reid!

This revision is now accepted and ready to land.May 27 2021, 8:24 PM
This revision was automatically updated to reflect the committed changes.