diff options
| author | Petr Hosek <phosek@chromium.org> | 2019-05-22 21:08:33 +0000 |
|---|---|---|
| committer | Petr Hosek <phosek@chromium.org> | 2019-05-22 21:08:33 +0000 |
| commit | 5f36acd30139445f7cf4920d6efc288c4bf0d566 (patch) | |
| tree | 78226c14ef9fd24a4910f30fd848503719641d0d /lib/Driver/ToolChain.cpp | |
| parent | ef51dce2c7d014cfe77ad7266f093ccc1b544332 (diff) | |
| download | clang-5f36acd30139445f7cf4920d6efc288c4bf0d566.tar.gz | |
[runtimes] Move libunwind, libc++abi and libc++ to lib/$target/c++ and include/c++
This change is a consequence of the discussion in "RFC: Place libs in
Clang-dedicated directories", specifically the suggestion that
libunwind, libc++abi and libc++ shouldn't be using Clang resource
directory. Tools like clangd make this assumption, but this is
currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build.
This change addresses that by moving the output of these libraries to
lib/$target/c++ and include/c++ directories, leaving resource directory
only for compiler-rt runtimes and Clang builtin headers.
Differential Revision: https://reviews.llvm.org/D59168
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChain.cpp')
| -rw-r--r-- | lib/Driver/ToolChain.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index dbb347c8bc..3b0e8f2dba 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -75,6 +75,13 @@ ToolChain::ToolChain(const Driver &D, const llvm::Triple &T, CachedRTTIMode(CalculateRTTIMode(Args, Triple, CachedRTTIArg)) { SmallString<128> P; + if (D.CCCIsCXX()) { + P.assign(D.Dir); + llvm::sys::path::append(P, "..", "lib", D.getTargetTriple(), "c++"); + if (getVFS().exists(P)) + getLibraryPaths().push_back(P.str()); + } + P.assign(D.ResourceDir); llvm::sys::path::append(P, D.getTargetTriple(), "lib"); if (getVFS().exists(P)) |
