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.
Is it possible to fix the problem in getCompilerRTBasename instead? I see 6-ish instances of this code pattern that need the same fix. It will require a small bit of refactoring to getCompilerRT.