[llvm] [dsymutil] Filter our swiftinterface files from the toolchain. (PR #71205)
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 3 12:52:34 PDT 2023
================
@@ -167,6 +167,21 @@ void CompileUnit::cleanupDataAfterClonning() {
getOrigUnit().clear();
}
+/// Make a best effort to guess the
+/// Xcode.app/Contents/Developer/Toolchains/ path from an SDK path.
+static SmallString<128> guessToolChainBaseDir(StringRef SysRoot) {
+ SmallString<128> Result;
+ // Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
+ StringRef Base = SysRoot;
+ Base = sys::path::parent_path(Base);
+ if (sys::path::filename(Base) != "SDKs")
+ return Result;
+ Result = Base;
+ Base = sys::path::parent_path(Base);
+ sys::path::append(Result, "Toolchains");
+ return Result;
+}
----------------
JDevlieghere wrote:
Sounds good, but I still think we should move all that in a `DWARFLinker` directory (i.e. on the filesystem) to avoid the proliferation of `DWARFLinker*` libs. The Transforms directory for example is good prior art for that.
https://github.com/llvm/llvm-project/pull/71205
More information about the llvm-commits
mailing list