[lld] [lld] handle re-exports for full framework paths (PR #137989)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 30 14:06:01 PDT 2025
================
@@ -1566,6 +1566,25 @@ static DylibFile *loadDylib(StringRef path, DylibFile *umbrella) {
return loadDylib(*mbref, umbrella);
}
+static StringRef findFramework(StringRef path, StringRef frameworkName) {
+ // Framework names can be in multiple formats:
+ // - Foo.framework/Foo
+ // - Foo.framework/Versions/A/Foo
+ size_t start;
+ size_t end = path.size();
+ while (true) {
+ start = path.rfind('/', end);
+ if (start == StringRef::npos)
+ return StringRef();
+
+ StringRef component = path.substr(start + 1, end - start - 1);
+ if (component == frameworkName)
+ return path.substr(start + 1);
+
+ end = start;
+ }
----------------
alx32 wrote:
The disadvantage of doing this is that you construct a new string and allocate new memory, etc. I guess this is okay if this function isn't going to be used excessively.
https://github.com/llvm/llvm-project/pull/137989
More information about the llvm-commits
mailing list