[PATCH] D97438: [lld-macho] Change loadReexport to handle the case where a TAPI re-exports to reference documents nested within other TBD.

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 15:28:10 PST 2021


jyknight added a comment.

IIUC, the requirement is:

- When loading a library from a TBD file, re-exports need to be looked up in the auxiliary documents within the same TBD. (even if no file on disk exists for the referenced library).
- When loading from an actual dylib, no additional TBD documents need to be examined.
- In no case does a re-export mentioned in one TBD file need to be looked up in a document in an auxiliary document from a different TBD file

So, with the addition of getParent() to InterfaceFile, I think this logic can be fully within within the Dylib(InterfaceFile*, ...) constructor, no external info required. It just needs to pass "interface" down to loadReexport/loadReexportHelper (which can call getParent() before accessing documents()).

So, I think all the other API changes can be reverted as unnecessary.

As for the test: Looks like you have only one TBD file, rather than the two in the original example: Cocoa (in Cocoa.tbd) re-exports AppKit (in AppKit.tbd) re-exports UIFoundation (also in AppKit.tbd). For your test, if you add a new "SystemReexport.tbd" which re-exports libSystem, I think that'd show the problem.



================
Comment at: lld/MachO/Driver.h:18
 
+namespace llvm::MachO {
+class InterfaceFile;
----------------
LLVM doesn't require C++17 yet, so you can't use this syntax.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97438/new/

https://reviews.llvm.org/D97438



More information about the llvm-commits mailing list