This is needed so lld-link can find clang_rt.profile when self hosting on Windows with PGO.
Trying to self host on Windows with PGO runs into undefined symbols as lld-link doesn't know to link clang_rt.profile as discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2019-January/129500.html
Using clang-cl as a linker knows to add the library but self hosting, using -DCMAKE_LINKER=<...>/lld-link.exe doesn't. I think that the cleanest way to make this work is to add a dependent library when using profile-instr-generate on Windows.
Note some cmake changes are also required to get PGO self hosting on Windows working. I will post them separately.
This won't work with ld.bfd, so I would restrict this to a Windows MSVC environment. For mingw, I'd expect the user to call the compiler to link, and the right library path to be supplied to the linker by the compiler driver.