This ensures debug symbols end up in the install root, alongside binaries. We treat Windows PDB files in this conditional too, as well as Mac/Linux debug symbol files, since they are effectively the same thing and are very likely to be processed identially in multi-platform scenarios.
The add_executable logic has been modified slightly to ensure the llvm_externalize_debuginfo function knows whether or not to install, despite that information not being known to the higher level add_llvm_executable or add_llvm_tool until later.