[llvm] [Object][COFF][NFC] Document writeImportLibrary. (PR #81600)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 04:44:44 PST 2024


================
@@ -135,6 +135,18 @@ struct COFFShortExport {
   }
 };
 
+/// Writes a COFF import library containing entries described by the Exports
+/// array.
+///
+/// For hybrid targets such as ARM64EC, additional native entry points can be
+/// exposed using the NativeExports parameter. When NativeExports is used, the
+/// output import library will expose these native ARM64 imports alongside the
+/// entries described in the Exports array. Such a library can be used for
+/// linking both ARM64EC and pure ARM64 objects, and the linker will pick only
+/// the exports relevant to the target platform.
+///
+/// For non-hybrid targets, the NativeExports parameter should not be used.
+/// Instead, pass std::nullopt or an empty array to this parameter.
----------------
mstorsjo wrote:

Actually, as most users won't need to care about this parameter at this point, and as it seems like this change can be disruptive to users, what do you think about moving the new parameter to the end of the parameter list, and adding a default `= std::nullopt` to it, to avoid forcing users to change right away?

I guess the usual LLVM policy is that we don't need to worry about downstream users, but IMO if we can avoid breaking them, that's of course even better.

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


More information about the llvm-commits mailing list