[Driver][Windows] Support per-target runtimes dir layout for profile instr generate
authorzero9178 <markus.boeck02@gmail.com>
Tue, 23 Feb 2021 21:34:27 +0000 (22:34 +0100)
committerzero9178 <markus.boeck02@gmail.com>
Tue, 23 Feb 2021 21:35:19 +0000 (22:35 +0100)
commit7f9d5d6e444c91ce6f2e377b312ac573dfc6779a
tree46db51e921677ecbd3f39d190ea57464e6730855
parent979ca1c05f83114483caec3e6d1b75daae86da79
[Driver][Windows] Support per-target runtimes dir layout for profile instr generate

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 getCompilerRT and getCompilerRTBasename to always consider per-target runtime directories. getCompilerRTBasename now simply returns the filename component of the path found by getCompilerRT

Differential Revision: https://reviews.llvm.org/D96638
clang/include/clang/Driver/ToolChain.h
clang/lib/Driver/ToolChain.cpp
clang/lib/Driver/ToolChains/BareMetal.cpp
clang/lib/Driver/ToolChains/BareMetal.h
clang/test/Driver/cl-options.c
clang/test/Driver/fsanitize.c
clang/test/Driver/instrprof-ld.c
clang/test/Driver/sanitizer-ld.c