diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2025-01-12 21:20:20 -0500 |
---|---|---|
committer | Tobias Hieta <tobias@hieta.se> | 2025-01-14 10:41:02 +0100 |
commit | cd708029e0b2869e80abe31ddb175f7c35361f90 (patch) | |
tree | 59c674c18e0bb2fe82680dc1a1c397657c0050b2 /clang/lib/Driver/Driver.cpp | |
parent | 37aaa06c44451233c1bae40c71738032f9b16bdc (diff) | |
download | llvm-release/19.x.zip llvm-release/19.x.tar.gz llvm-release/19.x.tar.bz2 |
Fix print module manifest file for macos (#122370)llvmorg-19.1.7release/19.x
This commit fixes -print-library-module-manifest-path on macos.
Currently, this only works on linux systems. This is because on macos
systems the library and header files are installed in a different
location. The module manifest is next to the libraries and the search
function was not looking in both places. There is also a test included.
(cherry picked from commit acbd822879f7727127926c25e1b47f5017f962c5)
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index ecae475..f9dc8ab 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -6189,6 +6189,11 @@ std::string Driver::GetFilePath(StringRef Name, const ToolChain &TC) const { if (auto P = SearchPaths(TC.getFilePaths())) return *P; + SmallString<128> R2(ResourceDir); + llvm::sys::path::append(R2, "..", "..", Name); + if (llvm::sys::fs::exists(Twine(R2))) + return std::string(R2); + return std::string(Name); } |