summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-03-15 18:08:20 +0000
committerChris Bieneman <beanz@apple.com>2016-03-15 18:08:20 +0000
commit7f2844f8f7874ae559376d0349ee2f5d00b2185e (patch)
tree3ea7364c86823024b0bbc53252addd48047fe1b4 /clang/lib/Driver/ToolChains.cpp
parentef43d448d4729194a7fc2b24dcd6f85d42c3740f (diff)
downloadbcm5719-llvm-7f2844f8f7874ae559376d0349ee2f5d00b2185e.tar.gz
bcm5719-llvm-7f2844f8f7874ae559376d0349ee2f5d00b2185e.zip
[Driver] [Darwin] Fix linking libclang_rt.profile_*sim.a
Summary: isTarget*() calls are order-dependent. This is because iOS Sim *is* iOS. This means checks for the simulator version of the platform must always be ahead of checks for the embedded platform. Reviewers: zaks.anna, bogner Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17947 llvm-svn: 263567
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
-rw-r--r--clang/lib/Driver/ToolChains.cpp30
1 files changed, 2 insertions, 28 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 03421d6739c..8be0684f125 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -353,34 +353,8 @@ void Darwin::addProfileRTLibs(const ArgList &Args,
ArgStringList &CmdArgs) const {
if (!needsProfileRT(Args)) return;
- // TODO: Clean this up once autoconf is gone
- SmallString<128> P(getDriver().ResourceDir);
- llvm::sys::path::append(P, "lib", "darwin");
- const char *Library = "libclang_rt.profile_osx.a";
-
- // Select the appropriate runtime library for the target.
- if (isTargetWatchOS()) {
- Library = "libclang_rt.profile_watchos.a";
- } else if (isTargetWatchOSSimulator()) {
- llvm::sys::path::append(P, "libclang_rt.profile_watchossim.a");
- Library = getVFS().exists(P) ? "libclang_rt.profile_watchossim.a"
- : "libclang_rt.profile_watchos.a";
- } else if (isTargetTvOS()) {
- Library = "libclang_rt.profile_tvos.a";
- } else if (isTargetTvOSSimulator()) {
- llvm::sys::path::append(P, "libclang_rt.profile_tvossim.a");
- Library = getVFS().exists(P) ? "libclang_rt.profile_tvossim.a"
- : "libclang_rt.profile_tvos.a";
- } else if (isTargetIPhoneOS()) {
- Library = "libclang_rt.profile_ios.a";
- } else if (isTargetIOSSimulator()) {
- llvm::sys::path::append(P, "libclang_rt.profile_iossim.a");
- Library = getVFS().exists(P) ? "libclang_rt.profile_iossim.a"
- : "libclang_rt.profile_ios.a";
- } else {
- assert(isTargetMacOS() && "unexpected non MacOS platform");
- }
- AddLinkRuntimeLib(Args, CmdArgs, Library,
+ AddLinkRuntimeLib(Args, CmdArgs, (Twine("libclang_rt.profile_") +
+ getOSLibraryNameSuffix() + ".a").str(),
/*AlwaysLink*/ true);
}
OpenPOWER on IntegriCloud