When targeting a MSVC triple, --dependant-libs with the name of the clang runtime library for profiling is added to the command line args. In it's current implementations clang_rt.profile-<ARCH> is chosen as the name. When building a distribution using LLVM_ENABLE_PER_TARGET_RUNTIME_DIR this fails, due to the runtime file names not having an architecture suffix in the filename.
This patch refactors getCompilerRTBasename to first try and find the version without the architecture suffix before then falling back to using the architecture suffix. Since no callers have explicitly used the AddArch parameter, and the correct choice is now autodetected by default it has also been removed.
This is the same as TT, right? Please use TT here or remove TT and use Triple across this function. I guess I lean towards keeping TT, but it's up to you.