[llvm] [dsymutil] Filter our swiftinterface files from the toolchain. (PR #71205)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 12:28:45 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;
+}
----------------
avl-llvm wrote:

Agreed, we need a way to share things. I would suggest a bit another solution. Let`s have DWARFLinkerBase library. Which would be linked to DWARFLinker and DWARFLinkerParallel. That library will contain all shared code. It also potentially could be used by other part trying to link DWARF. f.e. BOLT does similar things. 

What do you think on creating such a common library?

https://github.com/llvm/llvm-project/pull/71205


More information about the llvm-commits mailing list